I have a list of radio buttons built using html:
<input type="radio" name="role" value="aaaa" onclick="disableEnable(this.checked,'utype') "/>bbbb<br>
<input type="radio" name="role" value="ccccc" onclick="enableDisable(this.checked,'utype')"/>dddd(Please specify)<br>
<input type="radio" name="role" value="eeeet"/ onclick="disableEnable(this.checked,'utype')">ffff<br>
<input type="radio" name="role" value="gggg" onclick="disableEnable(this.checked,'utype')"/>hhhh<br>
<input type="radio" name="role" value="kkk"/ onclick="disableEnable(this.checked,'utype')"/>iiii<br>
<br>
now if they select the radio field "dddd", the list below gets activated through javascript.
test: <select id='utype' name='utype' disabled=true>
<option>Please Choose</option>
<option>AL</option>
<option>CA</option>
<option>TX</option>
<option>WI</option>
Now i want to use php to basically check if they have selected an option form the list only if they have selected the second radio button "cccc"
php code
I know you can do this:
if ($_POST) {
if (isset($_POST['role']) && !isset($_POST['utype'])) {
// Error, re-direct user back
header('Header: form.html');
} else {
// Process data
}
}
as a form of validation but the above does not differentiate between the different radio buttons in role, it treats them all as one. I want the php code to be able to differentiate between them. In javascript it would be done like this:
document.survey.role[b][1][/b].checked
With the specific radio button highlighted in bold
How can I do this? Thanks!