title: Ajax form submit after validating input elements
body: <p>I have a form which collects some information using text boxes. Some text boxes have a strick pattern, e.g. few input boxes take only numbers. </p>
  
  <p>I was able to add validation using pattern attribute of input field. <a href="http://www.w3schools.com/tags/att_input_pattern.asp" rel="nofollow">http://www.w3schools.com/tags/att_input_pattern.asp</a></p>
  
  <p>However, when user submits the form I need to do a ajax post request to a different end point. So, I think I have to make a call to preventDefault() method to prevent default form submit.</p>
  
  <p>But when I call preventDefault(), it also disables validating input fields.</p>
  
  <p>How can I achieve validating fields and make a ajax request, only if the input fields pass the validation.</p>