title: How to check any text box is not empty on jsp page?
body: <p>I have number of text boxes on jsp page. I want to check that every text boxes are not empty when I submit. When I submit and if any text box is empty than it should not allow to submit to servlet page. How to check that for multiple text boxes?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function checkvalue() { 
      var mystring = document.getElementById('uname').value;
      var mystring1 = document.getElementById('pass').value; 
      if(!mystring.match(/\S/) &amp;&amp; !mystring1.match(/\S/))
          {
              alert ('Empty value is not allowed');
              return false;
          }
      else 
          {
              alert("correct input");
              return true;
          }
      }
  </code></pre>
  
  <p>I have tried javascript as above. I just want to know how to reduce code for multiple text boxes?</p>