Hi All,
I have a form with a drop-down list where the User will select No or Yes.
If Yes is selected, I would like a text input box to be shown and one of my submit buttons to be enabled, whilst another submit button will automatically become disabled.
I am very new to this and have trawled the net looking for simple, easy-to-understand code and believe this can only be done with Javascript? So apologies if this is in the wrong forum.
My code snippets are:
Code:
<tr><td width="199" bgcolor="#260063">
<font color="#FFFFFF" face="Sky InfoText Bd">Emergency?: </font> </td>
<td width="17"> </td>
<td width="360"><select name="emergency">
<option value="No" show="none">No</option>
<option value="Yes" show="justification">Yes</option>
</select>
</td></tr>
<tr relation="justification"><span class="accessibility"> If Yes:</span><td width="199" bgcolor="#260063">
<font color="#FFFFFF" face="Sky InfoText Bd">PROVIDE JUSTIFICATION FOR EMERGENCY CHANGE: </font> </td>
<td width="17"> </td>
<td width="360"><textarea name="emergency_justification" rows="3" size="150" cols="38"></textarea></td></tr>
When I view the page, the PROVIDE JUSTIFCATION FOR EMERGENCY CHANGE input box is shown irrespective of whether Yes or No is selected.
So somewhere I have messed up the code.
Additionally, once YES is selected, I would like my "Submit to Change Control" button disabled and my "Submit Emergency Change" button to become enabled.
Code:
<input type="submit" name="Submit" value="Submit to Change Control">
<input type="submit" name="Submit1" value="Submit Emergency Change" disabled=true>
Would some simple SQL IF THEN statements deal with this?
Thanks in advance for any assistance,
Lynn
|