[Seaside] [Q] Anchor instead of Button in Form?

Lukas Renggli renggli at gmail.com
Mon Sep 24 08:15:34 UTC 2007


> 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


More information about the seaside mailing list