title: Disabling a text field for a particular selection in dropdown box
body: <p>My application includes a textField and a dropdown box. When i select "All Campaigns" i should have my textfield disabled and it should remain enabled when i select "This Campaign".The code is given below for reference but i m not getting any errors or exceptions.Plese help me.</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
      pageEncoding="ISO-8859-1"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;TextBoxDisabling&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
      function findselected() {
          document.getElementById('selmenu');
          document.getElementById('txtField');
          (state.value == "All Campaign") ? txtField.disabled = true
                  : txtField.disabled = false
      }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="" method="POST" name="form1"&gt;
  &lt;select name="selmenu"
      onChange="findselected()"&gt;
      &lt;option value="1"&gt;This Campaign&lt;/option&gt;
      &lt;option value="2"&gt;All Campaign&lt;/option&gt;
  &lt;/select&gt; &lt;input type="text" size="20" id="txtField" name="txtField"&gt;&lt;/form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>