Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q156 How can I submit a text field so that after pressing "return" or clicking button it would be possible to jump to another URL page, containing the description of that word entered in the text field?

irt.org | Knowledge Base | JavaScript | Form 10.3 | Q156 [ previous next ]

Q156 How can I submit a text field so that after pressing "return" or clicking button it would be possible to jump to another URL page, containing the description of that word entered in the text field?

Try:

<SCRIPT LANGUAGE="JavaScript"><!--
function myFunction() {
    location.href = document.myForm.myText.value + '.html';
    return false;
}
//--></SCRIPT>

<FORM NAME="myForm" onSubmit="return myFunction()">
<INPUT NAME="myText" TYPE="TEXT">
<INPUT TYPE="BUTTON" VALUE="Click Me" onClick="myFunction()">
</FORM>

To avoid "404 - Page not found " error messages - combine the above with the technique discussed in the article Intelligent Password Verification #2.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.