What I have set up right now is a login form and a signup form that is set into one page, but it toggles back and forth between the forms with some Jquery. When the login fo
A common method to solve this problem is to validate the sign-up fields via javascript before the form is submitted.
You can use javascript/jQuery to interrupt the submit process, check the value of each field, and - if one or more fields fails validation - return false
to return control back to the user in order to fix the problems and try again.
Here are some code examples and demos:
To interrupt the submit, you just use:
$('#id_of_your_form').submit(function(){
let var_valid = true; //any variable name will do...
//
//validation code goes here - see next demo below
//
if (!var_valid) return false;
//if the code gets here, it will continue submitting
});
Here is an example of how to do basic field validation.
http://jsfiddle.net/W4g4e/7/