[html-formfu] H::F::Model::DBIC and adding multiple empty rows

Carl Franks fireartist at gmail.com
Mon Apr 20 09:40:41 GMT 2009


2009/4/17 Lance A. Brown <lance at bearcircle.net>:
> Greetings,
>
> I'm working on a form that describes a paper, with a list of authors.  I
> let the user add additional author entries when creating a new paper or
> editing an existing one via javascript that insert the appropriate html
> fragment and increases the hidden counter variable to handle it, but
> this doesn't work.
>
> This works just fine when I'm adding a new paper.  All of the authors
> get inserted appropriately.
>
> If I edit a paper, using the same form, the current list of authors
> loads properly, and I have one blank entry for a new author.  If I add
> new author fields, fill them in, and submit the form, the parameters are
> sent, but the H::F::M::D seems to ignore all of the new authors except
> the first.
>
> Is this a deficiency in handling repeatables?

When you're modifying the client-side form with JavaScript, are you
updating the 'counter' hidden field, so the form builds the correct
number of Repeatable reps during $form->process() ?

Also, for the new rows, are you correctly incrementing the field names?

If it doesn't seem to work - dump $form->params(), so you can see
which params are being accepted.

Carl



More information about the HTML-FormFu mailing list