You are here: irt.org | About | Feedback | 3303 [ previous next ]
Feedback on:
irt.org FAQ Knowledge Base Q471
Sent by
Dave Hewitt on November 06, 2001 at 09:26:36:
Worth:
Worth reading
Length:
Too short
Technical:
Not technical enough
Comments:
The example does not work. I do have an alternative solution using the onsubmit event, which will tab through all fields until the visible submit button is reached and then submits the form from that button. The actual submit button is styled to have dimensions of 1x1, at least partially hiding it from the user. Not the most elegant answer, but it works :) :
<html>
<head>
<script>
var focusControl;
function doFocusChange() {
focusControl.focus();
return false;
}
function nextFocus(control) {
focusControl = control;
}
</script>
</head>
<body>
<form name="myForm" method="post" action="testForm.html" onSubmit="return doFocusChange()">
<input type="text" name="text1" onFocus="nextFocus(document.myForm.text2)">
<input type="text" name="text2" onFocus="nextFocus(document.myForm.text3)">
<input type="text" name="text3" onFocus="nextFocus(document.myForm.Submit)">
<input type="submit" width="1" style="width: 1; height: 1;">
<input type="button" name="Submit" value="Submit" onClick="submit()">
</form>
</body>
Other feedback on 'irt.org FAQ Knowledge Base Q471' - show all