[Seaside] Form Input for One Field
Boris Popov
boris at deepcovelabs.com
Thu Aug 16 12:47:05 UTC 2007
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: seaside-bounces at lists.squeakfoundation.org <seaside-bounces at lists.squeakfoundation.org>
To: Seaside - general discussion <seaside at lists.squeakfoundation.org>
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
Seaside at lists.squeakfoundation.org
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20070816/c0aa0f67/attachment.htm
More information about the seaside
mailing list