Easily done, but needs Javascript.  Do something like the following in your
JSP:

----------------------------------------------------------------------------
--------------------------------

<html>
<head>...</head>
<body onload="setFormFocus();">
...
<form name="my_form"...>
...
</form>
...
<script language="JavaScript">
<!--

function setFormFocus() {
    // Set the focus to the first empty input
    var eCount = this.my_form.elements.length;
    for (var i = 0; i < eCount; i++) {
        var e = this.my_form.elements[i];
        if ((e.type == "text") || (e.type == "password")) {
            if ((e.value == null) || (e.value == "")) {
                e.focus();
                break;
            }
        }
    }
}

-->
</script>

</body>
</html>

----------------------------------------------------------------------------
--------------------------------

This will set focus to the first empty field on your page's form.  Award
yourself bonus usability marks.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to