I have a client who needs a vacation registrations form that will do (among other things) the following:
I need a field that asks for the number of travelers in the group. This can be a number between 1 and 4. Based on the answer in this field, I need to display 1-4 sections, each identical, asking for required information on each of the travelers on the group.
So, if the registrant enters three travelers, I would need to display three sections for:
First Name
Last Name
Address
Phone
Email
Is that possible with CF?
Hi Rick,
Yes you can do this. Which version of ChronoForms are you using?
The simplest way is to add all four blocks into the page code but set to be hidden then use JavaScript to un-hide them as needed. There are some problem with validating hidden inputs in CFv3 but there is a workaround using Peter-Paul Koch's Hideable Forms code.
Bob
Hello Bob!
I have not started yet, so I can use whichever version is going to make this the easiest on me. If v4 will, then that's what I will use. The site is running on J1.5 (don't think that makes a difference, but just in case).
I greatly appreciate the pointer to what to do with the JavaScript. I can probably muddle through now that I know in which direction to muddle. :-)
If you could just let me know which version I should go with, I will get started! As usual, thanks for the prompt help!!!
Rick
Hi Rick,
Starting now I'd use CFv4 without a doubt. The learning curve is a little steep but once you get the hang of it it's more flexible than CFv3 and will be supported going forward with Joomla! 1.5 & 1.6
I think that the new validation library in CFv4 will also make it easier to turn validation on and off as inputs are hidden and un-hidden. You don't want a hidden input to be required. (That was the problem with CFv3.)
Technically I'd set up the form with all four 'people panels' displayed and then write the script to hide them onLoad and re-display as required.
Bob
Thanks, Bob. I will go with CFv4 and see how bad I can screw this up! 🙂
That didn't take long! I don't have the time to learn CFv4 for this project, and it was a bit daunting just looking at it!! This is a short-term form (will only be used through September of this year), so long-term is not an issue.
Rick
Bob,
I decided not to waste my time, and simply bought the guide you offered on your site. Well worth the $8. I will play around with it and report back if I have any questions!
Thanks!!!!
Rick
Bob,
I am using your tutorial, and it is fantastic!!! I have two questions:
1) I would like to use a drop-down box instead of a checkbox. This works, but requires a page refresh before displaying/hiding the sections. Any way to automate this when the selector is changed?
2) My selection is for a number of participants (1-4). If I select "3", the first three participant blocks should appear, but not the fourth. Is there any way you know of to create this? I have tried various ways to nest the DIV's, but it is not working.
Thanks!!!
That did it Bob. Thanks!!!!
BTW - the how-to doc has been invaluable!
Rick
Bob,
Back again on this topic!!
I have to do something like this again, and was wondering if it would be that same procedure under CFv4?
Rick