Hi, Conor,

As I recall, HtmlForm uses fairly straight-forward rendering and doesn't cater 
for JavaScript
commands such as focus or validation.

Kind regards

Bob

PS: Starting with Click 2.3.0 Behaviors could be used to set focus to a field 
instead of having that
responsibility on the form.
PPS: Seems HTML5 brings focus to input fields: 
http://www.phpguru.org/html5-autofocus-jump.html

On 21/09/2010 11:56, C Jennings wrote:
> Hi -
> I was wondering if anone has had any success with getting setFocus(true) to 
> work 
> with a HtmlForm or CssForm? 
>
> Using ContactDetailsPage.java as an example in the Click Examples project, if 
> i 
> set the focus on one of the fields to true as follows:
>       
> fieldset.add(new TextField("firstName")).setFocus(true);
>
> it doesn't put the cursor in the First Name text box, when i start up the 
> project and point to it on localhost. However, if I then change the form from 
> CssForm to Form, it works fine!
>
> Thank you,
>
> Conor
>
>
>       
>

Reply via email to