I am trying to create a HTML form and pass the value of the search field to append it to the URL.
For example:
Search: 123456
Press "Go" and the destination URL becomes
I know how the basic forms work, but I can't figure out how to append the base URL with the variable from the input.
<HTML>
<HEAD>
<SCRIPT type="javascript">
function goToPage(var url = '')
{
var initial = "
window.location(initial+url);
}
</SCRIPT>
<TITLE>Test</TITLE>
<BASE HREF="</HEAD>
<BODY>
<P>
<FORM name="something" action="#">
Search
<INPUT type="text" name="url" value="" onSubmit="goToPage(this.value)">
<INPUT type="submit" value="GO">
</FORM>
</BODY>
</HTML>
Any assistance would be greatly appreciated.
Thanks,
John
For example:
Search: 123456
Press "Go" and the destination URL becomes
I know how the basic forms work, but I can't figure out how to append the base URL with the variable from the input.
<HTML>
<HEAD>
<SCRIPT type="javascript">
function goToPage(var url = '')
{
var initial = "
window.location(initial+url);
}
</SCRIPT>
<TITLE>Test</TITLE>
<BASE HREF="</HEAD>
<BODY>
<P>
<FORM name="something" action="#">
Search
<INPUT type="text" name="url" value="" onSubmit="goToPage(this.value)">
<INPUT type="submit" value="GO">
</FORM>
</BODY>
</HTML>
Any assistance would be greatly appreciated.
Thanks,
John