[html-formfu] refresh of the form
Carl Franks
fireartist at gmail.com
Wed Mar 10 21:12:08 GMT 2010
On 10 March 2010 10:07, rahed <raherh at gmail.com> wrote:
> Hello!
>
> I want to replace my FormBuilder and start anew with FormFu.
>
> In my template I had:
>
> [% FormBuilder.render %]
> [% IF c.session.refresh %]
> <meta http-equiv="refresh" content="10"/>
>
> When I replace FormBuilder with form the
> form is no longer submitted when there is a refresh.
>
> The controller code is like this:
>
> sub run : Local : FormConfig('myconfig') {
> ($self,$c) = @_;
> $form = $c->stash->{form};
> if ($form->submitted_and_valid) {
> # code
> }
> }
>
> and myconfig has submit element:
>
> - type: Submit
> name: submit
> value: Submit
>
>
> I tried to include submit indicator in the config and something like
> this in the template:
>
> <meta http-equiv="refresh" content="10"/>
> [% form.get_field('submit').value = 'Submit' %]
> [% form.process %]
> [% form.render %]
>
> to no avail.
> The form is manually submitted with its values after clicking but when
> the page is refreshed, submitted is false.
I don't know why the behaviour is changing when you switch to FormFu -
are there any noticable differences in the outputted HTML?
I believe your
form.get_field('submit').value = 'Submit'
should be
form.get_field('submit').default = 'Submit'
Cheers,
Carl
More information about the HTML-FormFu
mailing list