[SOLVED] Removal of blank(ish) records saved by form with optional groups

chozma

Member
Hi guys,

Me again.... I wonder if you have any advice on how to solve this little gem? o_O

I have a form called 'animal' which saves details to a table called 'animal'. I have added a group to the 'animal' form called 'mob' which allows the user to assign the animal they are creating to a mob (another word for herd). This saves to a table called 'mob'. Its optional for the user to fill in the mob bit.

So I noticed that if the user fills in all the form (animal and mob bit) everything is great. However, if the user only fills in the animal bit and leaves the mob bit blank then a record is being generated in the mob table which is blank apart from the animal id, PK and date_time.

Now I can understand why it is generating this record but if the mob bit is left blank I don't want this record to be created. These blank records are causing all sorts of trouble elsewhere when I display data and I like things to be neat and tidy so don't really want these records to be made. ;)

How would you advise that I tell Fabrik to not create the mob record if the mob bit of the form is not filled in? Alternatively I suppose I could run some php on the table after the form has been saved to clean those records incomplete records out...

What would you experts recommend?

Thanks as always,

Hannah
 
if mob is a repeatable group set minimum to 0 in group's Repeat settings.

gesendet mit Tapatalk
 
Great thanks Troester! :D

I've set the mob group to be a repeatable group with a min of 0 and a max of 1 and it is no longer creating the blank record which is fab.

Thanks very much for the swift reply x
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top