0

I've a multipart (3 step) form which is in actuality just one form with sections shown / hidden as you press 'Next'. Each section is successfully showing / hiding the DIVs as you move through it but the validation that I'm using (I've tried JQuery Validate and Bootstrap validation) is validating the entire form rather than each section individually.

$('#myForm').validate({
//Every page is validated now
});

Either this validation happens on the final submit ( or if I change it to get triggered on the initial 'Next Step' button press then it validates the entire form at that stage).

I've read a very similar question to mine here but the solution isn't suitable, I can't split the form into multiple forms.

Is there a way of triggering form validation on sections of a shown / hidden form as I describe or am I better off trying to roll my own validation solution?

Full Time Skeleton
  • 1,680
  • 1
  • 22
  • 39
  • Are you submitting the data via Ajax or via form submit? If it is via ajax, or can be converted to ajax, you can use the multi-form process as you can pull the data via different forms. – imvain2 Apr 29 '19 at 22:23
  • The movement from step 1 to 2 and 2 to 3 will trigger Ajax calls, however, in terms of actually submitting the form I was planning on using form submit. – Full Time Skeleton Apr 29 '19 at 22:36
  • could you do something like the third answer here https://stackoverflow.com/questions/2086287/how-to-clear-jquery-validation-error-messages remove the errors for parts of the form that you do not want. maybe with a jquery selector – Bryan Dellinger Apr 30 '19 at 00:55

0 Answers0