I have a page for Registering a user. In that page i have divided fields in two tabs.All the fields are Required.If user did not enter field in first tab i get validation error in second tab since its a single page.how to control validation for second tab.
<ul>
<li>first tab</li>
<li>second tab</li>
</ul>
<div class="row setup-content" id="step-1"> //first tab
<input class='form-control' id='username' required='required' name='username' placeholder='First Name*' type='text' data-error="Please enter name field.">
<button id='next'>Next</button>
</div>
<div class="row setup-content" id="step-1"> //second tab
<input class='form-control' id='password' required='required' name='password' placeholder='Enter password' type='text' data-error="Please enter Password">
</div>
<script>
$('#next').click(// code for moving to second tab);
</script>
If i click next button without entering username,the username field gets highlighted and after entering username and moving to second tab by clicking next button, the password field is also highlighted because of error caused while not entering username.
Thanks in advance