|
Q682 Is it possible to cause a multi-field form to be submitted when the user hits the enter key no matter which field on the form the cursor is in?
irt.org | Knowledge Base | JavaScript | Form 7.1 | Q682 [ previous next ]
Q682 Is it possible to cause a multi-field form to be submitted when the user hits the enter key no matter which field on the form the cursor is in?
Try:
<SCRIPT LANGUAGE="JavaScript"><!--
function submit1() {
document.useridForm.passwordField.value = document.passwordForm.passwordField.value;
}
function submit2() {
document.passwordForm.useridField.value = document.useridForm.useridField.value;
}
//--></SCRIPT>
<FORM NAME="useridForm" onSubmit="submit1()">
<P>Userid: <INPUT NAME="useridField" TYPE="TEXT">
<INPUT NAME="passwordField" TYPE="HIDDEN">
<SCRIPT LANGUAGE="JavaScript"><!--
document.write('<\/FORM><FORM NAME="passwordForm" onSubmit="submit2()">')
//--></SCRIPT>
<INPUT NAME="useridField" TYPE="HIDDEN">
<P>Password: <INPUT NAME="passwordField" TYPE="PASSWORD">
<P><INPUT TYPE="SUBMIT">
</FORM>
|
Feedback on 'Q682 Is it possible to cause a multi-field form to be submitted when the user hits the enter key no matter which field on the form the cursor is in?'
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.