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

Feedback on: irt.org FAQ Knowledge Base Q471

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


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.