agr8lemon
07-31-2009, 05:49 PM
Hello everyone,
I am more comfortable with PHP than Javascript so I'm hoping someone can help me out with my question.
What I would like to have is an html form that has a combo box, and if someone select a certain selection in the combo box, then a hidden div right under it becomes visible.
That div would hold a pair of radio buttons, and based on the selection of those, another div may appear with a input field shows up.
<form OnSubmit="return ValidateForm(form)" action="mysql.php" method="post" name="form" >
<tr>
<td><img src="require.gif" align="center" width="7" height="5"> Employee Type</td><td colspan="3"><select name="type">
<option value="Please Select an employee type:">Please Select an employee type:</option>
<option value="Department Transfer">Department Transfer</option>
<option value="Previous Student">Previous Student</option>
<option value="Physician / P.A.">Physician / P.A.</option>
<option value="Volunteer">Volunteer</option>
<option value="Update Employee">Update Current Employee</option>
<option value="New Employee">New Employee</option>
</td>
</tr>
So based on this code, I'd like to make it where if someone selects Physician / P.A. from the combo box, then a pair of radio buttons show up underneath it asking lets say "choice1" or "choice2", if "choice2" is selected another div containing a text input field.
I've tried to do this with my limited JS knowlege, but have never gotten it to work so any help would be great!
Thank you~
I am more comfortable with PHP than Javascript so I'm hoping someone can help me out with my question.
What I would like to have is an html form that has a combo box, and if someone select a certain selection in the combo box, then a hidden div right under it becomes visible.
That div would hold a pair of radio buttons, and based on the selection of those, another div may appear with a input field shows up.
<form OnSubmit="return ValidateForm(form)" action="mysql.php" method="post" name="form" >
<tr>
<td><img src="require.gif" align="center" width="7" height="5"> Employee Type</td><td colspan="3"><select name="type">
<option value="Please Select an employee type:">Please Select an employee type:</option>
<option value="Department Transfer">Department Transfer</option>
<option value="Previous Student">Previous Student</option>
<option value="Physician / P.A.">Physician / P.A.</option>
<option value="Volunteer">Volunteer</option>
<option value="Update Employee">Update Current Employee</option>
<option value="New Employee">New Employee</option>
</td>
</tr>
So based on this code, I'd like to make it where if someone selects Physician / P.A. from the combo box, then a pair of radio buttons show up underneath it asking lets say "choice1" or "choice2", if "choice2" is selected another div containing a text input field.
I've tried to do this with my limited JS knowlege, but have never gotten it to work so any help would be great!
Thank you~