Forums

Endless Forms (dynamically adds fields in front-end)

jabba 06 Jun, 2017
Hello! I'd like to know if with chronoforms is possible a scenario like this:

- I as administrator create a form in backend that has a button "add field"
- A user can compile the form from frontend
-- If he pushes the button "add field" a filed named "field 1" is addedd and the user can fill it
-- If the user pushes again the button "add field" a field named "field 2" is added and the user can fill it
-- ...and so on, if the user continues pushes the button fields are added

Is this possible?

Thank you!
Gianluca
GreyHead 06 Jun, 2017
Answer
1 Likes
Hi Gianluca,

Yes, in CFv6 you can use the Repeater area action from the Areas action group in the Designer tab. This will let you add one repeating input element, or a group of elements.

Bob
jabba 06 Jun, 2017
Thank you! I missed the feature, it's very useful!
Another question about functionaluty (but i guess this is chronoconnectivity job): is there a way to save the "state" of a form? I mean that a user compile the form, saves it, and the return another day to modify the answers?
Thank you again,
Gianluca
Max_admin 07 Jun, 2017
Hi Gianluca,

Ye, just use a "Save data" action, but you need to have a table created first, and it should have a "user_id" field in order to save the user id, then you need to have a "read_data" action to load the data back.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
GreyHead 07 Jun, 2017
Hi Gianluca,

. . . and if you are using a Repeater you may want to use a second table for the repeater data.

Bob
jabba 07 Jun, 2017
Thank you for the tip, Bob. So when i store the repeater data in the second table i have to add some kind of ID to link it to the form in the first table? Or is kinda automatic?
I can find some tutorials or explanations here? https://www.chronoengine.com/faqs/74-chronoforms6.html Or there is another place (like a wiki) for table connecttions and data retrival?
Thank you again,
Gianluca
GreyHead 07 Jun, 2017
Hi Gianluca,

I would save the main record first, then grab the ID of the new record and use that in the second table to link the repeater records. I have no idea exactly how to do that with CFv6 :-( but I expect that it is similar to CFv5

Bob
jabba 07 Jun, 2017
Thank you again Bob, but if a user can create an endless number of fields how can i set a database where to save the data? Obviously i don't know how many fields the user will need. Do i have to set a large number of database columns and give a limit to the user? So if he don't use all the fields i'll just have empty columns in my database?
Thank you
Gianluca
GreyHead 07 Jun, 2017
Hi Gianluca,

In the second table you use one row for each field (or set of fields) - that avoids the problem of needing an unknown number of columns.

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