Click to See Complete Forum and Search --> : Dynamic hyperlink
RJ2003
04-28-2003, 09:45 AM
Hi experts !
I have a text, say "URL" which will be hyperlinked but the link should be dynamic. Next to this text, there will be a text box.
If the user writes http://www.yahoo.com in the textbox, the URL text should be hyperlinked with this value of the textbox.
Can I do this ?
Or am I being too ambitious ???
gil davis
04-28-2003, 09:51 AM
<form action="">
<input type="text" name="go">
<input type="button" value="Go!" onclick="this.form.action=this.form.go.value;this.form.submit()">
</form>
RJ2003
04-28-2003, 10:00 AM
There is no button here.
I have a text, which will be hyperlinked, and the url value of the this hyperlink will be whatever the user types in the text box next to this text.
Vladdy
04-28-2003, 10:47 AM
< a href="#" onclick="this.href=document.getElementById('URLField').value; return true;"> Link</a>
<input type="text" id="URLField" value="http://">
gil davis
04-28-2003, 11:31 AM
<form name="go" action="">
<input type="text" name="go">
<a href="#" onclick="document.go.action=document.go.go.value;document.go.submit();return false">Click Here to GO!</a>
</form>
Vladdy
04-28-2003, 12:51 PM
Why add a form when you do not need one:confused:
gil davis
04-28-2003, 01:43 PM
Vladdy:
That's what I started with, and didn't see any reason to change it. I was answering before I read your post.
It was also to show to RJ2003 that it's not that hard to change the button to something else, instead of giving him a totally new concept to absorb.
I don't know his level of expertise.