Login Retreive lost passwordRegister
Search

Forum Index / General / Dynamic repeating form section

[ This topic is solved ]

  Chad 16 May 08 / 19:15  
Here is our scenario. we are working on a registration form.

Building the form for demographics is no problem, it has a static number of elements identified by the fields in our database: first name, last name, email, street address, blah, blah, blah...

The tricky part comes in when we want to give the person the ability to add a certain number of objects that may have multiple fields each. For example a registration form that allows you to register your family for an event. The primary person will enter the demographics as above. The "family" members repeating fields would be: name (text), TShirt (select), child under 10 (checkbox).

We want to repeat the text box, selection box and check box for however many children are in the family.

Can someone suggest how to manage that type of form using FormHandler?

Thanks!!

  Johan Wiegel (Admin) 16 May 08 / 19:33  
if you just want to use formhandler take a look at the newpage function.

In the first part you ask for the number of familie members, that value can be used to make the second part of the form.

An other solution is to use AJAX to generate the extra fields.

  Chad 16 May 08 / 21:01  
Thanks Johan!

So my question now becomes, how's the beta status? Is this a entirely new feature just introduced or is it more like a release candidate?

I really appreciate all of your help through the forums!

  Johan Wiegel (Admin) 16 May 08 / 23:47  
Save to use as far as we know.

  Chad 17 May 08 / 14:30  
Thanks for the heads up. I will build a few forms using the NewPage feature, test as much as possible and report back here as soon as it's ready.

  Chad 05 June 08 / 00:48  
All,

Here's some info on the NewPage feature.

We found it difficult to identify which "page" you were viewing / processing. I'm still not sure exactly when the "page" is identified. When a field validator fails at the top of the form, is the page set to next or current? What if the last field is the one that failed, is the page set then? In our situation, we need to call a function to add the dynamic fields based on one of the answers from a "page." The current page seemed incorrect in certain situations. We had to have the value of something that had not been posted yet based on the sequence of pages but the loop to add those fields had to be part of the file so the fields could be added to the $form object. I'll post some code after we clean it up a bit.

We found it easier to simply redirect the browser to a new form (new php file) with the number of "additional" questions to ask in the $_GET collection (keeping our master ID as well). In other words, we built a series of PHP files to simulate our own pages and each file could have X number of options which is passed on the querystring.

I hope that helps.

Chad

  Johan Wiegel (Admin) 23 October 08 / 09:21  
As far as we used the newpage function we found it working as expected

  Top


powered by PHP-GLOBE   © 2004 - 2009 FormHandler. All rights reserved.   -   Open source license