title: Dis-able Submit button until all fields are selected
body: <p>In this part of code we need to disable submit button until all fields are selected or-else every thing gets messed up! So is it possible to disable the submit button ? If so kindly help us!! </p>
  
  <pre><code>           out.println("&lt;html&gt;&lt;body&gt;&lt;form action=''&gt;");
              out.println("&lt;br&gt;&lt;center&gt;&lt;h1&gt;&lt;font color='red'&gt;Detailed DocID Status&lt;/font&gt;&lt;/h1&gt;");
              out.println("&lt;br&gt; Year &lt;select name='year'&gt;");
              out.println("&lt;option value=''&gt;Select Year&lt;/option&gt;");
  
              for(int i=2010;i&lt;=2020;i++){
                  out.println("&lt;option value="+i+"&gt;"+i+"&lt;/option&gt;");
              }
                  out.println("&lt;/select&gt;");
  
              out.println(" &amp;nbsp;&amp;nbsp;&amp;nbsp; Month &lt;select name='month'&gt;");
  
                  out.println("&lt;option value=''&gt;Select Month&lt;/option&gt;");
                  out.println("&lt;option value='01'&gt;Jan&lt;/option&gt;");
                  out.println("&lt;option value='02'&gt;Feb&lt;/option&gt;");
                  out.println("&lt;option value='03'&gt;Mar&lt;/option&gt;");
                  out.println("&lt;option value='04'&gt;Apr&lt;/option&gt;");
                  out.println("&lt;option value='05'&gt;May&lt;/option&gt;");
                  out.println("&lt;option value='06'&gt;June&lt;/option&gt;");
                  out.println("&lt;option value='07'&gt;July&lt;/option&gt;");
                  out.println("&lt;option value='08'&gt;Aug&lt;/option&gt;");
                  out.println("&lt;option value='09'&gt;Sep&lt;/option&gt;");
                  out.println("&lt;option value='10'&gt;Oct&lt;/option&gt;");
                  out.println("&lt;option value='11'&gt;Nov&lt;/option&gt;");
                  out.println("&lt;option value='12'&gt;Dec&lt;/option&gt;");
  
                  out.println("&lt;/select&gt;");
  
              out.println(" &amp;nbsp;&amp;nbsp;&amp;nbsp; Status : &lt;select name='status'&gt;&lt;option value='Select Status'&gt;Select Status&lt;/option&gt;&lt;option value='Approved'&gt;Approved&lt;/option&gt;&lt;option value='Clarifications'&gt;Clarifications&lt;/option&gt;&lt;option value='Pending'&gt;Pending&lt;/option&gt;&lt;/select&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; ");
              out.println("&lt;input type='submit'id='submit' name='subBtn' value='Submit' disable='disabled' onClick=doenable()&gt;");
              out.println("&lt;/form&gt;&lt;/body&gt;&lt;/html&gt;");
              out.println("&lt;br&gt;&lt;br&gt;");
  </code></pre>
  
  <p>Function we tried </p>
  
  <pre><code> function doenable()
          {
              if(document.getElementById("year")!=null)
              {
                  if(document.getElementById("month")!=null)
                      {
                          if(document.getElementById("status")!=null)
                              {
                                  document.getElementById("subBtn").disabled=false;
                              }
                      }
  
                }
  
          }
  </code></pre>