title: How to show an hidden div if a required field is highlighted?
body: <p>for a series of circumstances I need to update an old ASP classic site.
  My users need to fill one form that is divided in two <code>divs</code> that they can activate (display) clicking on a button.</p>
  
  <p>Instead of doing complicate checks I found useful the <code>required</code> attribute of HTML 5 but unfortunately I have some problem when the required field is in the hidden part of the form.</p>
  
  <p>If the user submits the form and the required field (not filled) is located in the hidden <code>div</code> the browser displays the alert but, obviously, not the field (because is in the hidden <code>div</code>).</p>
  
  <p>Is it possible to automatically show the hidden part of the form in which the <code>required</code> field is located?</p>
  
  <p>Some code on the fly:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form action="anagraphic.asp" method="post"&gt;
      &lt;div id="divName" style="display:inline"&gt;
          Name &lt;input id="inputName" name="inputName" type="text" required /&gt; 
          &lt;input name="Button1" type="button" value="Next"   
              onclick="document.getElementById('divName').style.display='none';document.getElementById('divSurname').style.display='inline';"/&gt;
      &lt;/div&gt;
      &lt;div id="divSurname"style="display:none"&gt;
          &lt;input name="Button2" type="button" value="Previous" 
              onclick="document.getElementById('divSurname').style.display='none';document.getElementById('divName').style.display='inline';" /&gt;
          Surname &lt;input  id="inputSurname" name="inputSurname" type="text" required  /&gt;
          &lt;input name="Submit1" type="submit" value="submit" /&gt;
      &lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>Let's say that you "forget" to fill the <em>name</em> field and you click on <em>Next</em>.
  You fill surname and you submit the form: immediately the embedded alert appears. Substantially I would like to intercept the event that highlights the required field and at the same time show the first <code>div</code> the one with the name.</p>
  
  <p>Is it possible?</p>