title: Javascript to enable, disable drop down menu in JSP file having Java code only, no HTML directly
body: <p>Let me introduce the design.</p>
  
  <p>Each field in a JSP is made by a <code>Map</code>.
  The label name, the input type (drop down or other), the input values, the default values, etc are added to the <code>Map</code>, say <code>Map nameAttributes</code>.
  There is another class, <code>GeneralWriter writer</code>, to which I do not have access, which takes the values from <code>Map</code>, parses them and writes the proper HTML code.</p>
  
  <p>After writing the Map, <code>writer.writeSelectBox(nameAttributes);</code> is called.</p>
  
  <p>Now, the requirement is:<br>
  There is a drop-down menu, depending upon its selected value, some other drop-down menus are disabled (shown in UI, but not modifiable) or enabled.
  Since, I am not writing HTML code for the added field, I can not write the function call events to do my job.</p>
  
  <p>I have observed that a JS function is called on <code>onMouseOut</code> event from the fields, as seen in <code>"View Source"</code>.
  So I thought I might write my code there to check the field value and impact other drop-down menus.
  But if I write <code>alert</code> in the JS function (just to check), it won't alert me, means the function is not called and I can not write the enable/disbale code.</p>
  
  <p>Is there any way to achieve the job. The enabling and disabling should depend on what user selects in one of the drop downs.</p>
  
  <p>Sample code:</p>
  
  <pre class="lang-jsp prettyprint-override"><code>&lt;%
  Map nameAttr = new HashMap();   
  nameAttr.put(GeneralConst.INPUT_MESSAGE, Const.MSG_FIELD_NAME);
  //.....
  
  writer.writeAllSelectBox(nameAttr);
  %&gt;
  </code></pre>
  
  <p>Urgent help needed, thanks.</p>