Simple HTML help

Robert La Ferla robertlaferla at comcast.net
Fri Mar 24 21:06:53 EST 2006


Tom Metro wrote:
>
> Technically, this can't be done with just HTML. But a little bit of 
> JavaScript will accomplish what you want to do. Assigning the value of 
> the form control holding the URL to the window.location.href property 
> will cause the redirect to occur. That assignment could happen in 
> response to clicking a button. Google "window.location.href" and you 
> should turn up hundreds of examples.

You beat me to it!  I was trying to get submitting via enter to work.  
But this is how it is done with a button:

<HTML>
<HEAD>
<TITLE>Simple Redirect</TITLE>
</HEAD>
<BODY>
<FORM NAME="myform">URL:
<INPUT TYPE="text" NAME="url" VALUE=""> 
<INPUT TYPE="button" NAME="button" Value="GO" onClick="window.location = 
myform.url.value">
</FORM>
</BODY>
</HTML>



More information about the Discuss mailing list