UI Deploy

Curated, Short, Web UI Dev we Love.

Submit Form with jQuery Ajax

Previously I have written tutorials on Insert data using jQuery and PHP without refreshing the page. In that tutorial we were submitting form by creating data string and then sending it to PHP using $.post. So just consider if you have large number of fields in your form then it would be difficult plus more error prone to create a data string. So in case of long forms we must avoid creating data strings (name value pair) manually. In this tutorial we will use .serializeArray() method to create an array of names and values.

view source

Advertisement