I have a form that has a multi-div value: I fill in some fields, then I click next, and the current div gets the css proprerty display as "none".
All fields in this form are required, the following is a fragment 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 empty, it will not be submitted and Chrome will give me the following error in the console
An invalid form control with name = 'input1' is not configurable.
How can I solve this situation? I thought about catching the error and then showing the first div, but I did not understand how to do this.
source share