[Q] Anchor instead of Button in Form?

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

[Q] Anchor instead of Button in Form?

Chun, Sungjin
Hi,

I want to use anchor instead of submitButton -  which is rather hard to style.
I've tried search google but I cannot find working solution. What I've tried is

canvas anchor url: 'javascript:submit()'

with defaultAction:  at form.

(The form element is in the lightbox.)

As you know :), I cannot make this work. with submitButton,  the component in
the lightbox correctly answer: the edited object. But with anchor, even the lightbox
does not close. If I press enter in the textfied, then it works - this means the defaultAction:
does work.

Can anyone help me on this? I'm  using latest Seaside 2.8(pmm.488) in SqueakSource.

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

Re: [Q] Anchor instead of Button in Form?

Lukas Renggli
> I want to use anchor instead of submitButton -  which is rather hard to style.
> I've tried search google but I cannot find working solution. What I've tried is
>
> canvas anchor url: 'javascript:submit()'
>
> with defaultAction:  at form.

There is a #submitFormNamed: defined in WAAnchorTag.

> As you know :), I cannot make this work. with submitButton,  the component in
> the lightbox correctly answer: the edited object. But with anchor, even the lightbox
> does not close. If I press enter in the textfied, then it works - this means the defaultAction:
> does work.

The #defaultAction: is **only** triggered "when the user presses enter
without having the focus on a specific submit button" (see the method
comment). If you submit a form using some JavaScript trickery, the
form's default action is **not** evaluated. You might want to add a
hidden form field with a callback to the end of your form, if you want
to perform an action in any case (user clicks a button, javascript
submits form, ajax serializes form, etc).

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside