Skip to content
Loading
Html 5 required validation with ajax without refreshing the page.
  • Sachin Singh
    @varun ,your solution causes to refresh the page for submitting the form
  • Sachin Singh
    Ok i think i got the solution
     
    what don't works :-
    1. $("#btn").submit()  -> it causes refresh.
    2.$("form").submit() -> it causes refresh
     
     what works:-
    $("#formid").submit()
     
    meaning ,in order to use html 5 form validations without page refresh we have to use submit event with id or related selector  of form only.
  • Varun Setia
    Hi, 
     
    Are you looking for something like this,
     
    HTML Code: 
    1. <input type="text" id="email"/>  
    2. <button id="submit-btn">Submitbutton>  
    3. <div id="debug">div>  
     JQuery:
     
    1.