Link to home
Start Free TrialLog in
Avatar of js1138
js1138

asked on

Need to make a drop down selection enable a REQUIRED FIELD

I have a drop down box with 5 options:
<select size="1" name="_fnm_hmo_plan1">
        <option selected value="Please Select">Please Select</option>
        <option value="na">N/A</option>
        <option value="HMO">HMO</option>
        <option value="Open Access HMO">Open Access HMO</option>
        <option value="QPOS">QPOS</option>
        <option value="Aetna Choice POS">Aetna Choice POS</option>
        </select>

I also have 3 input text fields:
<td width="48%" valign="top" align="left" style="border-style:none; border-width:medium; "><b>Group Number(s):</b>
        <input type="text" name="_fnm_HMOcontrol" size="40" ></td>
       </tr>
       <tr>
        <td width="48%" valign="top" align="left" style="border-style:none; border-width:medium; "><b>AQC Quote ID(s) and Quote Option Name(s):</b><input type="text" name="_fnm_HMO_AQC_quote" size="40" ></td>
       </tr>
       <tr>
        <td width="48%" valign="top" align="left" style="border-style:none; border-width:medium; "><b>Guide Quote ID(s):</b>
        <input type="text" name="_fnm_HMO_GUIDE_quote" size="40" ></td>

The desired result:
If anything other than "N/A" is selected from the drop down. At least one or all of the 3 fields needs to be filled in. In which case they become required.

Any thoughts or samples are much appreciated.

Again the user may not need to fill out all three fields but at least one needs to be required in order to submit or
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enzogoy
enzogoy

I don't really understand your question much.  Is it like this:

If "_fnm_hmo_plan1" is not N/A then
   If "_fnm_HMOcontrol" equal null and "_fnm_HMO_AQC_quote" equal null and "_fnm_HMO_GUIDE_quote" equal null then
         Error message

Is this what you want?  If so I can translate it to jscript.

enz
:)
HainKurt has done it.
Avatar of js1138

ASKER

Thanks for the solution and prompt response