I know to use Html 5 validation with ajax we generally use submit event handler and not button with preventDefault click like below
- <form method="post" id="subsForm">
- <div class="input-group">
- <input type="email" required>
- <input type="submit">
- </div>
- </form>"
- $('form').submit(function(event){
- event.preventDefault();
- $.ajax(){
-
- }
- });
Ok , thats a good solution to force Html 5 validation to work without submitting the form but it violates the definition of Ajax and causes to refresh the page when page is submitted with satisfied validations.
Is there any solution till date to use html 5 validations without page refresh.