title: onChange() not working fine
body: <p>In the below jsp, when i change the dropdown list the values are not getting cleared. please help me with it. But the other function(Enable()) is working fine. Could any one please let me know where am i going wrong.</p>
  
  <pre><code>&lt;%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  
  &lt;title&gt;Untitled Document&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
      document.getElementById("Comp_Text").value=document.getElementById("tgt1").value;
      function Enable(){
          if(document.getElementById("abcd").value=="DAIS")
              {
                      document.getElementById("c1").disabled=true;
                      document.getElementById("c2").disabled=true;
                      document.getElementById("c3").disabled=true;
                      document.getElementById("c4").disabled=true;
                      document.getElementById("c5").disabled=true;
                      document.getElementById("c6").disabled=true;
                      document.getElementById("c1").value='0';
                      document.getElementById("c2").value='0';
                      document.getElementById("c3").value='0';
                      document.getElementById("c4").vaue='0';
                      document.getElementById("c5").value='0';
                      document.getElementById("c6").value='0';
                      document.getElementById("tot1").readOnly=false;
              }
              else
                  {
                      document.getElementById("c1").disabled=false;
                      document.getElementById("c2").disabled=false;
                      document.getElementById("c3").disabled=false;
                      document.getElementById("c4").disabled=false;
                      document.getElementById("c5").disabled=false;
                      document.getElementById("c6").disabled=false;
                      document.getElementById("tot1").readOnly=true;
                  }
  
      }
      function Sum()
      {
          var int1=document.getElementById("c1").value;
          var int2=document.getElementById("c2").value;
          var int3=document.getElementById("c3").value;
          var int4=document.getElementById("c4").value;
          var int5=document.getElementById("c5").value;
          var int6=document.getElementById("c6").value;
          document.getElementById("tot1").value=parseInt(int1)+parseInt(int2)+parseInt(int3)+parseInt(int4)+parseInt(int5)+parseInt(int6); 
      }
      function clear(){
                      document.getElementById("c1").value='';
                      document.getElementById("c2").value='';
                      document.getElementById("c3").value='';
                      document.getElementById("c4").vaue='';
                      document.getElementById("c5").value='';
                      document.getElementById("c6").value='';
      }
  
  &lt;/script&gt;
  &lt;/head&gt;
  
      &lt;body&gt;
  &lt;form id="form1" name="form1" method="post" action="UpdateCounts_DB.jsp"&gt;
      &lt;input type="text" name="Comp_Text" id="Comp_Text" value="&lt;%=(String)request.getParameter("tgt1")%&gt;" size="100" style="border: 0"/&gt;
      &lt;table width="420" cellspacing="3"&gt; &lt;tr&gt;&lt;td width="37"&gt;Types&lt;/td&gt;
    &amp;nbsp;
    &amp;nbsp;
    &amp;nbsp;
    &lt;td width="127"&gt;
        &lt;select name="abcd" id="abcd" onchange="Enable();clear()" &gt;
            &lt;!--&lt;optgroup label="a"&gt;--&gt;
            &lt;option value=""&gt;Select the Type&lt;/option&gt;
            &lt;option value="Updates"&gt;Updates&lt;/option&gt;  
            &lt;option value="Multibases"&gt;Multibases&lt;/option&gt;
            &lt;option value="DAIS"&gt;DAIS&lt;/option&gt;
            &lt;option value="Acds"&gt;Admin Codes&lt;/option&gt;
            &lt;option value="Legis"&gt;Legis&lt;/option&gt;
            &lt;option value="LegAll"&gt;Legis-All&lt;/option&gt;
            &lt;option value="Ins"&gt;Ins And Reg&lt;/option&gt;&lt;!--&lt;/optgroup&gt;--&gt;&lt;/select&gt;&lt;/td&gt;
            &lt;td width="236"&gt; &lt;font size="-1" color="#0033CC"&gt; Select your Update Type From the Drop Down&lt;/font&gt;
            &lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;
    &lt;p&gt;
      &lt;label for="DB Count"&gt;DB Count&lt;/label&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
      &lt;input type="text" name="DB_Count" id="DB_Count" style="width:30px" value="&lt;%String abc=(String)request.getAttribute("abc");%&gt;"/&gt;
    &lt;/p&gt;
      &lt;font size="5" color="#0033CC"&gt;Fill all the below fields, enter Zero if there are no changes in a section&lt;/font&gt;
    &lt;table width="312" border="0"&gt;
      &lt;tr&gt;
        &lt;td width="156"&gt;&lt;label&gt;
        Summary&lt;/label&gt;&lt;/td&gt;
        &lt;td&gt;&lt;label for="c1"&gt;&lt;/label&gt;
            &lt;input type="text" name="c1" id="c1" style="width:30%" onchange="Sum();"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;label&gt;
      Contents&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="c2" id="c2" style="width:30%" onchange="Sum()"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;label&gt;
      Citation Formats&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="c3" id="c3" style="width:30%" onchange="Sum()"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;label&gt;
        Searching and Fields&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="c4" id="c4" style="width:30%"  onchange="Sum()" /&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;label&gt;
      Related Research&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="c5" id="c5" style="width:30%" onchange="Sum()"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;label&gt;
      Legal Notices&lt;/label&gt;&lt;/td&gt;
          &lt;td&gt;&lt;input type="text" name="c6" id="c6"  style="width:30%" onchange="Sum()"/&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;&lt;td&gt;Update Count&lt;/td&gt;&lt;td&gt;
              &lt;input type="text" name="tot1" id="tot1" style="width:30%" readonly="readonly"/&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
    &lt;p&gt;
      &lt;input type="submit" name="Enter" id="Enter" value="Submit" /&gt;
        &lt;/p&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks</p>