whiteyoh 0 Posting Pro in Training

Hi All,

I want to be able to have a form element greyed out unless other elements are satisfied.

Ive got the following code so far, but i cant seem to get it to recognise that i have made the selection. Also im wondering how to make it only ungrey if more than 1 element is satisfied.

<script>
        function checkObjection(selectMenu) {
            selectedOption = selectMenu[selectMenu.selectedIndex].value;

			

            if(selectedOption == "notinterested") {
                document.forms.calloutcomeform.objection.disabled = false;
            } else {
                document.forms.calloutcomeform.objection.disabled = true;
            }

            if(selectedOption == "") {
                document.forms.calloutcomeform.setcalloutcome.disabled = true;
            } else {
                document.forms.calloutcomeform.setcalloutcome.disabled = false;
            }

			CompletedValidation(selectMenu);


        }


        </script>
</head>
 <body onLoad="Javascript:document.forms.calloutcomeform.objection.disabled=true;document.forms.calloutcomeform.setcalloutcome.disabled=true;">
 <form name="calloutcomeform"  method="post">

<select name="outcome">
<option>
<option value="completed">Completed
<option value="">----
<option value="noanswer">No Answer
<option value="notinterested">Not Interested
<option value="wrongnumber">Wrong Number
<option value="answermachine">Answer Machine
<option value="callback">Callback
<option value="callback1">Callback After 6pm
</select>
                   
Objection: <select name="objection">
          <option>
          
          <option>Hung up
          <option>Business Ceased
          <option>No time available
          <option>No Longer Use		
          <option>Has Never Used
          <option>Forgot they had an account		
                          
</form>
</body>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.