Posts

Showing posts with the label validation

No validation don't show next fieldset

No validation don't show next fieldset I'm creating a multi-step form using this example - codepen.io/orozcokapo/pen/LmgjYg codepen.io/orozcokapo/pen/LmgjYg But, I want that in second fieldset, first validate required input textfield (I am using only one Textfield on second fieldset for mobile number input) and the button to go to the next step should work if the required field is not empty. I am unable to code it in JQuery. Could you please guide me how to do that? 1 Answer 1 First, designate which inputs are required by giving them the required attribute. Then, at the Next button's click function, move current_fs = $(this).parent(); to the top and add this code required current_fs = $(this).parent(); var inputs = current_fs.find("input[required]"); if(inputs.is((i,el) => $(el).val() == "")) { alert("Please fill out all required fields"); retur...