g118481
asked on
How to disable a form field?
I need to disable a form field when "EV" is selected from a drop-down list.
The drop-down field already has an "onClick" event assigned to it.
Any ideas how to do this?
The drop-down field already has an "onClick" event assigned to it.
Any ideas how to do this?
ASKER
This is only part of what I need.
If "EV" from the drop down list is selected in the form, then the other drop down list "reasonout" needs to be disabled.
How can I do that?
Increasing points.
If "EV" from the drop down list is selected in the form, then the other drop down list "reasonout" needs to be disabled.
How can I do that?
Increasing points.
if(document.formname.dropd ownname.op tions[docu ment.formn ame.dropdo wnname.sel ectedIndex ].value == "EV")
{ code to disable goes here }
{ code to disable goes here }
ASKER
Mitch,
Could you be more specific of how to setup the code, where in relation to the form it goes, and how it works?
So, if this were my form where would I insert the code?
<form>
<select name=event>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
<select name=reasonout>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
Just trying to ask the correct question in order to understand your suggestion more fully.
Thanks
Could you be more specific of how to setup the code, where in relation to the form it goes, and how it works?
So, if this were my form where would I insert the code?
<form>
<select name=event>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
<select name=reasonout>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
Just trying to ask the correct question in order to understand your suggestion more fully.
Thanks
Who is mitch? Do you have this question posted somwhere else as well?
ASKER
sorry, i thought m stood for Mitch.
ASKER
MRICHMON,
Sorry for calling you Mitch, it was an honest mistake.
Could you be more specific of how to setup the code, where in relation to the form it goes, and how it works?
So, if this were my form where would I insert the code?
<form>
<select name=event>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
<select name=reasonout>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
Just trying to ask the correct question in order to understand your suggestion more fully.
Thanks
Sorry for calling you Mitch, it was an honest mistake.
Could you be more specific of how to setup the code, where in relation to the form it goes, and how it works?
So, if this were my form where would I insert the code?
<form>
<select name=event>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
<select name=reasonout>
<option value=EV>EV</option>
<option value=AT>AT</option>
</select>
Just trying to ask the correct question in order to understand your suggestion more fully.
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Is there a way to have two "onchange" events for the "event" drop-down select?
As I mentioned in my initial posting, this event drop-down already has an onchange event that populates a third drop-down list.
Any suggestions?
As I mentioned in my initial posting, this event drop-down already has an onchange event that populates a third drop-down list.
Any suggestions?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This works perfect.
Thanks.
Thanks.
Basically you just use javascript to change the status to disabled.
http://www.quirksmode.org/js/disabled.html