title: use multiple span error classes with single text box
body: <p>I put the form validation with span in my previous example
  <a href="https://stackoverflow.com/questions/7836326/cannot-display-all-warning-message-in-form-validation-with-span/7836468#7836468">cannot display all warning message in form validation with span</a></p>
  
  <p>but when I use more than 1 validation on a single field then I face problem to show in span like</p>
  
  <pre><code> var x=document.forms["reg"]["email"].value;
    var atpos=x.indexOf("@");
     var dotpos=x.lastIndexOf(".");
   if(x ==null || x=="")
   {
     document.getElementById("error2").innerHTML = "enter Email"
  
     $var=false;
   }
   if (atpos&lt;1 || dotpos&lt;atpos+2 || dotpos+2&gt;=x.length)
   {
     document.getElementById("error3").innerHTML = "enter correct Email"
     $var=false;
   }
  </code></pre>
  
  <p>and in form field are</p>
  
  <pre><code>                &lt;td&gt;Email:&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" name="email" id="email"    /&gt;&lt;span id="email_error" style="color:red;"&gt;&lt;/span&gt;
                  &lt;span id="error2" style="color:red;"&gt;&lt;/span&gt;
                  &lt;span id="error3" style="color:red;"&gt;&lt;/span&gt;&lt;/td&gt;
  </code></pre>
  
  <p>If I use this code and leave the field blank then it shows both errors like 
  "ENTER EMAIL ENTER CORRECT EMAIL". How can I fix this?</p>