My PHP file performs 2 operations: 1. sends data from the form to the database table, 2. sends email.
What I want to do is show status messages via ajax. For example, βThe first operation completed, please wait a second,β and then when the second operation is completed, the following message βThe second operation completed tooβ will appear. Now my Ajax looks like this.
How can i change this?
//add status data to form form.data('formstatus', 'submitting'); if (validate()) { //send data to server for validation $.ajax({ url: formUrl, type: formMethod, dataType: "json", data: formData, success: function (data) { $.notifyBar({ cls: data.status, html: data.message }); form.data('formstatus', 'idle'); } }); }
source share