0

I'm learning Jquery, so that it's not easy for me to Implement what i want.

I'v a html form which validate using jquery validation plugin. So after validate is complete I want to send the form data to php page. In php page all data will be go to mysql database and after successfully inserted it should be show a successful message which (success message) will be get back to jquery submitHandler() so that I can show the success message in same page. Can you please show my how can i do this ?

$.validator.setDefaults({
    submitHandler: function() { alert("submitted!"); }
});

Note : Without Alert message

Babu
  • 455
  • 2
  • 14
  • 33
  • You're using the jQuery Validate plugin. You need to look into the documentation of that plugin, not only of jQuery generally. See http://jqueryvalidation.org/documentation/ – hakre Apr 20 '14 at 17:10
  • @hakre is it possible to send data to php and get the result in request page after validate ? – Babu Apr 20 '14 at 17:12
  • No, but it is possible to disable browser-form-submition, serailizing of the form-data, sending the form-data via ajax request to page, get back the result - all together after validate. – hakre Apr 20 '14 at 17:17
  • sure it is, just send the data using $.ajax and then load() the returned data into a div on your result page, from the call back function. – themerlinproject Apr 20 '14 at 17:25
  • @hakre can show me an example ? – Babu Apr 20 '14 at 17:27
  • This is one: http://stackoverflow.com/a/11469666/367456 - for example. – hakre Apr 20 '14 at 17:32

0 Answers0