[html-formfu] form->process not working!

Carl Franks fireartist at gmail.com
Sat Oct 18 22:58:13 BST 2008


2008/10/18 Ben Sommer <ben at bensommer.com>:
> On Sat, Oct 18, 2008 at 5:33 PM, Carl Franks <fireartist at gmail.com> wrote:
>>
>> 2008/10/18 Ben Sommer <ben at bensommer.com>:
>> > Thanks for the swift response, Carl.
>> >
>> > The dump you requested is attached.
>>
>> indicator() is set to 'submit'
>> but your submit button is named 'save', so submitted() will never be
>> true, as there's no submitted parameter named 'submit'
>
> Thanks Carl -- good catch that the submit button was named "save".
>
> Unfortunately, I do this on purpose -- I explicitly check for this field and
> don't use the "submitted()" or "submitted_and_valid()" methods.
>
> My "$form->params" data structure is still undefined after I invoke
> $form->process($c->request) -- whatever element names I use.
>
> Any more hunches on this?

process() calculates submitted(), and if it's false, will return
without building the params structure.

$form->params() only contains known and valid values, which can't
happen if it thinks there's been no form submitted.

I suggest you just remove your indicator setting, that way submitted()
will be true if any known field is submitted, and process() will build
the params as you expect.

Carl



More information about the HTML-FormFu mailing list