Using jQuery Validation Plugin to validate then hide email field without submitting form yet
For a two-part form, where the first div shows just the email address and the second div, initially hidden, shows the rest of the fields, is it wise to use the jQuery Validation Plugin validator.element()
https://jqueryvalidation.org/Validator.element/ to validate for the email address before hiding that and showing the remaining form fields?
For example, can this be done without a form submitHandler following?
- $("#emailDisplay").validate({
- rules: {
- emailAddress: {
- required: true,
- email: true
- }
- }
Then afterwards, there would be logic to hide the #emailDisplay and show the #fieldsDisplay.