How to set default pushbutton? Re: How to set focus on text fields?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set default pushbutton? Re: How to set focus on text fields?

Carl Gundel
>
> Try this, with the classic api :
>
>     html autofocus: [
>         html textInputWithCallback: [:value | self acceptedValue: value] ]
>
> There is also #autofocus:withCursorAt:
>
> With the canvas api :
>
>     html textInput setFocus; etc.

Thanks, that worked for setting the focus on the input field.  Any
suggestions for making the submit button the default pushbutton?

-Carl Gundel, author of Liberty BASIC
http://www.libertybasic.com


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to set default pushbutton? Re: How to set focus on text fields?

Michel Bany-3

>Thanks, that worked for setting the focus on the input field.  Any
>suggestions for making the submit button the default pushbutton?
>
>  
>
Oops, sorry I only answered part of your questions.
I think something like this should do.

html form:
     [html defaultAction: [self buttonClicked].
     ...
     html submitButtonWithAction: [self buttonClicked] text: 'Accept'.
     ...
     ]

Can also be written like this

html formWithDefaultAction: [self buttonClicked] do:
     [
     ...
     html submitButtonWithAction: [self buttonClicked] text: 'Accept'.
     ...
     ]

With the canvas api, it would be something like this :

html form defaultAction: [self buttonClicked]; with:
     [
     ...
     html submitButton callback: [self buttonClicked]; text: 'Accept'.
     ...
     ]

HTH
Michel.


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside