[html-formfu] Re: Always HTTP Method POST

Moritz Onken onken at houseofdesign.de
Tue Feb 23 10:34:09 GMT 2010


> If you submit a form which fails on a constraint other than
> RequestToken, correct the input value, then submit again the second
> submission will fail for the RequestToken constraint.
> 
> The Plugin seems to remove the token regardless of whether there are
> other errors in the form or not meaning users only get one chance to
> click submit. It should only remove the token from the session on a
> successful submission.

Hi,

I fixed this in the SVN repo. Could you please check it out and try it?

http://html-formfu.googlecode.com/svn/trunk/Catalyst-Controller-HTML-FormFu/

> Second issue is setting an error message. By default it sets the error
> message to 'form_constraint_requesttoken' which shows up at the bottom
> of the form under the submit button and I do not see an easy way to
> change it. I suppressed it with
> span.error_constraint_requesttoken {display: none;} and added a
> template toolkit wrapper to form.render which digs into
> form.get_error(name => '_token') to set a good error message at the
> top of the form.

This is kind of fixed. I changed the error message to something reasonable.
If you want to change the error message, please add the RequestToken 
Element and the Constraint by yourself. See the RequestToken plugin
for more details. 

If you have a better idea, please speak up!

I hope this helps and you are still willing to use this feature :-)

cheers,

moritz



More information about the HTML-FormFu mailing list