Creating a post from data returned from HTML form
I worked it out and re-wrote the code: jQuery(document).ready(function() { jQuery(‘#createacostume’).submit(function( event ) { event.preventDefault(); var aForm = jQuery(this); var bForm = aForm.serializeArray(); bForm.push({name: ‘action’, value: ‘myAjaxFunction’}); jQuery.ajax({ url: ajaxurl, type: “POST”, data: bForm, success: function(resp) { alert(“Thank you for your post. We will review it and approve it shortly” + resp); }, error: function( … Read more