| re: Putting an URL from FORM to address bar (no new window)
Kuba Glad wrote on 04 apr 2004 in comp.lang.javascript:[color=blue]
> I've spent some time using google, and reading basic manuals about Java
> Scripts and forms, but I can't find solution to this simple problem.
>
> In web page I want a such type of form like shown below. When someone
> enters an URL to text box, and hits return or clicks on "go" button,
> browser would load desired page (but without opening new page).
>
> <form name="enter_url">
> <input type="text" name="address" >
> <input type="button" name="go" value="GO">
> </form>[/color]
<form
onsubmit="
location.href=
document.getElementById('myText').value;
return false;">
<input type="text" id="myText">
<input type="submit" value="GO">
</form>
URL with http:// necessary, both enter and button click work
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress) |