[Seaside] Setting focus on Input field in form
Brett Taylor
brett.taylor at healthauditors.com
Tue Mar 16 00:57:10 CET 2004
I am trying to set focus on a particular input field in a form on the
load of the document. In other systems, I've done this by creating a
script that sets focus on the desired field on the load of the
document. This is how I do it.
<HTML>
<SCRIPT>
function setFocus() { document.form1.field1.focus() }
</SCRIPT>
<BODY onLoad=setFocus()>
<FORM name=form1 >
<input name="field1" value="test" type="text"></input>
</FORM>
</BODY>
</HTML>
I've been experimenting with Seaside, and have not been able to do
this. I set an onLoad attribute in the body element of the document. I
set the form's name attribute to "form1" Next I added a script method to
my WAComponent subclass which contains the above script (with the
correct field name).
UserRegistrationForm>>script
^'function setFocus() { document.entryForm.4.focus();}'
Focus is not getting set when I come into the form. Any tips on how to
do this?
Thanks,
Brett Taylor
More information about the Seaside
mailing list