[html-formfu] empty_rows prevents javascript from creating new rows

Moritz Onken onken at houseofdesign.de
Fri Jul 17 08:36:25 GMT 2009


Hi,

I had the exact same issue.

My form config looks now like this:

  - type: Hidden
    name: count
    constraints:
      - Required
  - type: Repeatable
    nested_name: appointment
    counter_name: count
    model_config:
      new_rows_max: 100
    elements:
      ...

which seems to work fine as long as you update the "count" field.

cheers,

moritz
Am 16.07.2009 um 21:50 schrieb Ascii King:

> I have a Catalyst / DBIC / Formfu setup that has a form that allows  
> for repeatable elements. I also have some javascript code that adds  
> new rows. I took this code from http://www.formassembly.com.
>
> This javascript code:
> * copies the first row of elements in the repeatable (via clone in  
> the DOM)
> * renames them so they match properly
> * provides a link to remove the new row
>
> All of this used to work fine until Formfu's latest update. The  
> method by which repeatable elements were named changed, so I had to  
> change the script. I have that all working properly, but now, even  
> though the elements are named properly, they won't save.
>
> Does this have something to do with the empty_rows attribute? Does  
> the new empty_rows attribute only allow the exact number of rows it  
> specifies? Formfu didn't used to have this limitation.
>
> If I have an element in a repeatable section called  
> appointments_1.date and I create a new one called appointments_2.date
> Example: I have an element called
> Appointments_1.Date
>
> If I create my own field called
> Appointments_2.Date
>
> it should be saved when the form is saved.
>
> Here's a pic to show what I mean: http://www.swattermatter.com/images/Screenshot.png
>
> _______________________________________________
> 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