Link to home
Start Free TrialLog in
Avatar of erzoolander
erzoolander

asked on

Determining value of secondary input based upon primary

Okay, so I've got a stupid question.  Here's a model of what I'm working with.

https://jsfiddle.net/5bxjxwj4/2/

There's a webform that's dynamically created based upon database entries (course 1, course 2, ... course X).  The user selects the a number of tickets based upon the select next to the price.

What would be the best way of determining which price has been selected on form submission?
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

First problem - duplicate id's - id's must be unique on the page.
Second problem - duplicate names - the second one will overwrite the first ... actually the submission will be something like
adnum_1=4&adnum_1=2

Open in new window

But even if you process the raw POST you can't tell which is which.

Just give your selects different names like
adnum_68 and adnum_70
That way you can check the values of those variables when they are submitted to see how many of each ticket was requested.
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial