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

Ascii King tech at swattermatter.com
Thu Jul 16 19:50:06 GMT 2009


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



More information about the HTML-FormFu mailing list