Form Input for One Field

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

Form Input for One Field

Richard Eng
I have a strange problem. In the following form, I want the user to enter a
username (email address), press Return, and thereby submit the form. But if
this field is the only one with textInput, pressing Return doesn't seem to
do anything. I need a second field, say, #dummy, in order to enable submit
by pressing Return. (The focus can remain in the first field; the dummy is
not used.)

Either way, clicking on the submit button works, but I also want the Return
key to do the same thing.

 html form:
  [html div
   class: 'row';
   with:
    [html span
     class: 'formlabel';
     with: [html text: 'your username'].
    html span
     class: 'forminput';
     with: [html textInput on: #emailAddress of: user]].

"The following dummy field is needed to enable carriage return submit."
  html div
   class: 'row';
   with:
    [html span
     class: 'formlabel';
     with: [].
    html span
     class: 'forminput';
     with: [html textInput on: #dummy of: user]].

  html div
   class: 'spacer';
   with: ' '.

  html div
   class: 'row';
   with:
    [html span
     class: 'formlabel';
     with: [html text: ''].
    html span
     class: 'forminput';
     with:
      [(html submitButton class: 'submit'; on: #save of: self) text:
'submit']]]


If the dummy field is needed, is there a way to make it hidden or invisible?
Is there a better way to achieve what I'm doing here?

Thanks,
Richard

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

Re: Form Input for One Field

Boris Popov, DeepCove Labs (SNN)
Re: [Seaside] Form Input for One Field

Just set #defaultAction: callback on a form that is the same as the one on your submit button.

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: Seaside - general discussion <[hidden email]>
Sent: Thu Aug 16 05:42:07 2007
Subject: [Seaside] Form Input for One Field

I have a strange problem. In the following form, I want the user to enter a
username (email address), press Return, and thereby submit the form. But if
this field is the only one with textInput, pressing Return doesn't seem to
do anything. I need a second field, say, #dummy, in order to enable submit
by pressing Return. (The focus can remain in the first field; the dummy is
not used.)

Either way, clicking on the submit button works, but I also want the Return
key to do the same thing.

 html form:
  [html div
   class: 'row';
   with:
    [html span
     class: 'formlabel';
     with: [html text: 'your username'].
    html span
     class: 'forminput';
     with: [html textInput on: #emailAddress of: user]].

"The following dummy field is needed to enable carriage return submit."
  html div
   class: 'row';
   with:
    [html span
     class: 'formlabel';
     with: [].
    html span
     class: 'forminput';
     with: [html textInput on: #dummy of: user]].

  html div
   class: 'spacer';
   with: ' '.

  html div
   class: 'row';
   with:
    [html span
     class: 'formlabel';
     with: [html text: ''].
    html span
     class: 'forminput';
     with:
      [(html submitButton class: 'submit'; on: #save of: self) text:
'submit']]]


If the dummy field is needed, is there a way to make it hidden or invisible?
Is there a better way to achieve what I'm doing here?

Thanks,
Richard

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


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