[html-formfu] One to many inserting lots of blank rows
Carl Franks
fireartist at gmail.com
Tue Oct 16 09:30:06 GMT 2012
On 15 October 2012 15:47, scott <scott at simpzoid.com> wrote:
> I have a form with a 1-to-many relationship which uses a repeatable block.
>
> The default behaviour worked perfectly when I only had text boxes. I.e. if
> the repeatable row contained all blanks no row was inserted into the
> database if there was something worth inserting it got inserted.
>
> Unfortunately when I added a text field I now get a row for every row in the
> repeatable block. Is there a way to change this behaviour so rows with
> nothing but the default date do not get inserted.l
Hi Scott,
If the Repeatable contains another field which is required for
insertion, you could add the "ignore_if_empty" option to that field -
for example
elements:
- name: title
model_config:
ignore_if_empty: 1
- name: date
type: Date
Would that work for you here?
Carl
More information about the HTML-FormFu
mailing list