Hello everyone,

I'm having one annoying problem with a script I didn't even write.
First of all, let me just point out the issue;

If you goto this address (site is in french): LINK
You'll notice that it's a dynamic calculator, if you choose "individual" and click next, it'll show you just 1 row but if you choose "family of two, three or more" it'll show you extra rows depending on the number you've picked.

What I wanna do here is IF the user chooses "family of two" or more, to separate the table in the next step by making the rows "Age" and "NSSF" the only variable fields while when he selects the "Class Type" for one of the family, it should be applied to all the rest at once.

I hope I wasn't too confusing in this.

For example, if I choose "family of 3" and click next, the next table should be split into 2, first the user has to:

- "Class Type" which will be selected only once but applied to the 3 persons in the family.
- "Couverture Ambulatoire"
- "Couverture Médicament "
- "Couverture Visites Médicales"

After the user finishes making his selection, he should then find another table below where he'll be able to select the "Age Range" and "NSSF" for each of the 3 persons separately. I can't be any clearer than this, I did my best

Anyway, here is the code which is all found in 1 single file. (attached below policy.php.txt)

Help is pretty much appreciated... thanks.
__________________

by clicking to the mentioned URL, we get:
Authorization Required

To make dynamic textfields, you need to ask,

how many person: ________  submit ...

You can then dynamically create inputs and select boxes to get the further categories.

1th Age ___  , Name _____
2th Age ___  , Name _____
3th Age ___  , Name _____
Submit
1th Age 5  , Name xxxx , 25% escompte
2th Age 36  , Name yyyy ,  
3th Age 77  , Name vvvv , 25% escompte
Total:   __ euro
Submit

on submit, you check the ages, if its under X , you won't ask. If these categories comes from a table, you need to set age ranges for each entry, or set aage categories for easier maintenance.
Based on the person age, you can get the available options.

Sorry I left it the username and password out

user: axa
password: guest

I appreciate you taking the time to look into this. If you check the attached txt file (policy.php.txt) you'll see that everything you've mentioned above is already done but what I'm looking for is to transform the whole table into something else which is kinda hard for me to do coz I don't exactly understand how the previous developer did this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.