I have a link that needs to update automatically. Whatever url i have in an input text i want that value to be the href value for a link.
This is what i have right now:
function changePreviewUrl(event)
{
$('.theForm:eq(' + event.data.i + ') [name=previewUrlLink]').attr('href', "http://"+ $('.theForm:eq(' + event.data.i + ') [name=previewUrl]').val());
}
The link changes dynamically as it is suposed to but if i have in my input text: "http://www.google.com". The value i get in my href attribute is: "http//www.google.com".
Whatever I tried, i couldn get the colon (after http it's supposed to be a colon before the "//").
Any ideas why this happens and how can i fix it?
Thank you very much for your time and help.

New Topic/Question
Reply



MultiQuote




|