[html-formfu] How to save repeatable fields inserted by javascript

Moritz Onken onken at houseofdesign.de
Fri Feb 20 16:01:58 GMT 2009


Please have a look at the New_empty_Row_multi Tests.

Am 20.02.2009 um 10:24 schrieb cosmin at sns.ro:

> Hello all,
>
> I have a form with initialy 1 repeatable element.
>
>   ---
>   elements:
>     - type: Hidden
>       name: count
>       value: 1
>     - type: Block
>       elements:
>         - type: Repeatable
>           counter_name: count
>           nested_name: profiles
>           model_config:
>             new_empty_row_multi: name
>           elements:
>             - type: Hidden
>               name: profile_id
>             - type: Text
>               name: name
>               label: Name
>
>
> To that Repeatable element, I am adding from javascript, another  
> "row".
> This is done by copying the existing last row, incremending the input
> names(profiles.profile_id_2, profiles.name_2) and count.
>
> In my controller:
>
>    $form->process( $c->req->params );
>    return unless $form->submitted_and_valid;
>    $form->model->update( $some_db_row );
>
> The problem is that only the initial existing "row" from that  
> Repeatable
> element is saved. The ones I add from js are ignored.
>
> What am I doing wrong here?
>
>
> Best regards,
> Cosmin
>
>
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu



More information about the HTML-FormFu mailing list