B
BB
Hello,
I have a HTML form containing multidimensional selects listing
equipments and their quantitites. This allow the users to select the
kind of equipment and quantitites they would like to book. Upon
onChange select event I would like to parse the data into a
multidimensional Javascript array in order to check equipment
availability for booking. But I can't figure out how to parse and upon
JS HTML DOM reference I am not even sure it's possible.
For example one select lists available cameras:
<tr>
<td>
<label>Digital camera</label>
</td>
<td>
<select name="camera[]" size="1" >
<option value="0" >0</option>
<option value="1" >1</option>
</select>
</td>
</tr>
<tr>
<td>
<label>Video camera</label>
</td>
<td>
<select name="camera[]" size="1" >
<option value="0" >0</option>
<option value="1" >1</option>
</select>
</td>
</tr>
For info, in my real situation, this select is dynamically populated
using PHP querying a database. All the booking processing is done with
PHP after the form has been posted. I now need to do some pre-flight
test and guess JS is the right guy to do so.
So, is there anyone with helpful ideas for parsing this
multidimensional HTML select into a multidimensional JS array?
Thank you,
I have a HTML form containing multidimensional selects listing
equipments and their quantitites. This allow the users to select the
kind of equipment and quantitites they would like to book. Upon
onChange select event I would like to parse the data into a
multidimensional Javascript array in order to check equipment
availability for booking. But I can't figure out how to parse and upon
JS HTML DOM reference I am not even sure it's possible.
For example one select lists available cameras:
<tr>
<td>
<label>Digital camera</label>
</td>
<td>
<select name="camera[]" size="1" >
<option value="0" >0</option>
<option value="1" >1</option>
</select>
</td>
</tr>
<tr>
<td>
<label>Video camera</label>
</td>
<td>
<select name="camera[]" size="1" >
<option value="0" >0</option>
<option value="1" >1</option>
</select>
</td>
</tr>
For info, in my real situation, this select is dynamically populated
using PHP querying a database. All the booking processing is done with
PHP after the form has been posted. I now need to do some pre-flight
test and guess JS is the right guy to do so.
So, is there anyone with helpful ideas for parsing this
multidimensional HTML select into a multidimensional JS array?
Thank you,