K
K
Koreetz Koreetz2018-08-23 13:13:55
JavaScript
Koreetz Koreetz, 2018-08-23 13:13:55

Make a transition between pages with forms?

Good day everyone.
Do not judge strictly - I'm just starting to study the development.
There are several pages with forms - there is a "Next" button to navigate between pages.
The task is to make it so that without filling out the forms, the transition to the "Next" button was impossible.
1) I used jquery validation for validation - everything is fine here.
2) How can I bind to the button until the validation of not going to the next page has passed?
3) Logically, it looks like this:
--- find the element (Next)
--- Hang a click event handler on it
--- Then the if condition (the form has passed validation - OK) {activate the button and go to the next page}
--- else (the form did not pass validation - ERROR) { no transition to the next page}

But it's still difficult for me to implement it in practice: The
snag is in two things:
1) What I don't know how to check in the condition - has the form passed validation or not?
2) How to make the Next button be in two states when the form did not pass validation when clicking on the button, it showed that the fields were not filled, and accordingly, when the form passed validation, it worked as a link and there was a transition to the next page with the form.
project

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question