I'm working on a custom registration page, where the user is submitting information about several people. There are about a dozen required fields. One button saves the form data into the database and stays on the same page. That works. The other button also saves the form data, but then goes to a payment page. By default that button only works if the form is filled out.
What I want to do is pre-validate the required fields and if any of them are missing, skip submit but go on to the payment page if at least 1 person was registered.
Here is a simplified web page:
Can someone help me with the custom code needed to do any of the following?
The Add Another Person needs to keep track of how many times it was pressed.
The Register and Pay button should be disabled until the form is completely filled in or there was at least 1 person added.
The submit should be skipped if the form is partially filled in, but it should be allowed to continue to the payment page.