i have a form which has :
<form name="myForm" action="a.php" method="post">
<fieldset>
<label>class</label>
<select>
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<label>Subject</label>
<select>
<option>some value from database</option>
<option>some value from database</option>
<option>some value from database</option>
<option>some value from database</option>
</select>
</fieldset>
<form>
the thing is:
i want to show the 3 options(1,2 and 3) from the first drop down select values for the user. Suppose the user selects 1 then s/he will get corresponding values from database as the drop down values of the 2nd select. Then s/he will select one from these drop down values. finally the form will be submitted manually. Obviously depending on the first drop down select value, the second drop down select value will change accordingly.
So the challenge is to take the value from the first select drop down values to use it in the second select drop down values BEFORE THE FORM IS SUBMITTED MANUALLY. How can I do that? I am using php. What else do I need?
ADDED LATER:
so far I have got idea about the solution of the posted prob.
NOW think that,
I have to retrieve values for the second drop down list depending on the first one. If have a third drop down value to retrieve from database depending on the first and second one , and then a fourth drop down value depending on the first three , and so on for the fifth, sixth ... then how can I implement that please?
all the drop down <select></select> elements will sit side by side horizontally on the same page.