Forums

storing a form with "add more" as part of the form

travelmotion 12 Dec, 2012
Hello,

i was very happy to find the article "How can I have a button to add more form inputs?" --> http://www.chronoengine.com/faqs/2700-how-can-i-have-a-button-to-add-more-form-inputs.html

That was exactly the option I need for my booking form! I build the form, alltogether seem to be fine. Then I did build in the neccecary actions - alltogethe ssem to be fine, too.

But, then I went back to the "Form Manager" to create the related db-table. And here I got the message:

"Field name "addone_{$j}" is invalid, please fix the field name in the wizard (or the form code) then retry again.
Field name "recipient[{$i}][name]" is invalid, please fix the field name in the wizard (or the form code) then retry again.
Field name "recipient[{$i}][Geburtsdatum]" is invalid, please fix the field name in the wizard (or the form code) then retry again."

...............

The necessary field will be created during filling out the form - in that case its clear, that there are no field ids the db-creation can use - what can i do?

Do I have to go to the database, to create the necessary fields for myself?!

.................

And another question - I tried to store these inputs with the "db-safe" action. But not inside the Joomla-Table structure, but with the advanced option "safe to different database". Up to now, I didnt managed it once to get a connection - always "DB Connection Failed!

Is there a trick to get it running?!
GreyHead 12 Dec, 2012
Hi travelmotion,

You will need to work out how you are going to save this repeated data in a database table. That will depend on the maximum number of repeats and the use you are going to make of it.

You can:

A) Add a fixed number of new columns to your table with the names that will be generated (use the Debugger action to see what they are). You'll need to add the columns by hand.

b) Use one big column of type text or blob and serialise or JSON encode all of the data to save it in one 'lump'.

c) Use two linked tables and save each of the repeated results in a new record linked to the 'parent' table by the parent table record id.

Bob
This topic is locked and no more replies can be posted.