[Seaside] How to set focus on text fields?

Carl Gundel carlg at libertybasic.com
Sat Jun 10 16:47:30 UTC 2006

I generate some pages that have a text field using code like this:

html form:
     [html text: self text , '?'.
     html textInputWithCallback: [:value | self acceptedValue: value].
     html submitButtonWithAction:
       [self accepted: true.
       self triggerEvent: #inputAccepted with: self]
      text: 'Accept'.
     html div]

When the page loads I need to be able to automatically set the input focus
to the field so the user can just start typing, and then when Enter is
pressed the submit button should get triggered.  Is there a Seaside
'convenience way' to do this, or if not how would I set about doing this in
Seaside 'the hard way'?  ;-)

Also, is there any way to generate a page such that the view scrolls down to
a particular WAComponent when the page loads?


-Carl Gundel, author of Liberty BASIC

More information about the Seaside mailing list