I've setup a testing site to experiment with ChronoForms. I'm trying to do the following (example😉):
- Form 1: ask the user how many fingers he/she has.
- Form 2: create a field for every finger the user has.
Assuming someone has 10 fingers, form 2 should show 10 fields. These could be just text, or selectboxes, or whatever input type I feel fits my need. Displaying is easily done using a loop in PHP, no problems so far. Every field gets it's own name, finger[1], finger[2], etc.
Trouble is, Chrono doesn't know the names of the fields, because they where created by PHP on requesting the page.
Is there any way to make this work? I'm looking for a very scalable solution that works up to, say, 50 to 100 fields.
I can imagine a 'hack' where I insert a piece of HTML that contains 10 hidden fields that have the same name as the fields that I dynamically generate (so, a list from finger[1] to finger[10]) so Chrono always records 10 fields and allows me to select validation for them. Then have the user's browser sort out which fields are duplicate and which value to POST.
But before I will try this hack, I'd like to know if there are any better and scalable solutions.
Hope my question is clear😉
Thanks in advance.
- Form 1: ask the user how many fingers he/she has.
- Form 2: create a field for every finger the user has.
Assuming someone has 10 fingers, form 2 should show 10 fields. These could be just text, or selectboxes, or whatever input type I feel fits my need. Displaying is easily done using a loop in PHP, no problems so far. Every field gets it's own name, finger[1], finger[2], etc.
Trouble is, Chrono doesn't know the names of the fields, because they where created by PHP on requesting the page.
Is there any way to make this work? I'm looking for a very scalable solution that works up to, say, 50 to 100 fields.
I can imagine a 'hack' where I insert a piece of HTML that contains 10 hidden fields that have the same name as the fields that I dynamically generate (so, a list from finger[1] to finger[10]) so Chrono always records 10 fields and allows me to select validation for them. Then have the user's browser sort out which fields are duplicate and which value to POST.
But before I will try this hack, I'd like to know if there are any better and scalable solutions.
Hope my question is clear😉
Thanks in advance.