I have a form which is a multi-div meaning: I fill some fields, then I click next and current div gets to display css proprerty set as "none".
All the fields in this form are required, below is a snippet of the situation:
<form action="" method="post">
<div id="div1" style="display:none">
<input name="input1" type"text" required />
<input name="input2" type"text" required />
</div>
<div id="div2" style="display:block">
<input name="input3" type"text" required />
<input name="input4" type"text" required />
<input type"submit" value="submit" />
</div>
</form>
Now the problem is that, when I submit the form, if one field of the first div is not filled up, it won't submit and Chrome gives me the following error in the Console
An invalid form control with name='input1' is not focusable.
How can I solve this situation? I've thought about catching the error and then showing the first div, but I haven't figured out how to do it.