I have a form with a submit button like this:
<form action="?edit-form" method="post" class="addEdit">
<input type="submit" name="delete-image" value="Delete Image">
</form>
My jQuery AJAX is:
$.ajax({
url: $('form.addEdit').attr('action'),
type: $('form.addEdit').attr('method'),
data: $('form.addEdit').serialize(),
success: function(html) { }
});
In my PHP, I am unable to pick up that $_POST['delete-image'] isset() eventhough the submit button that sent the form is named "delete-image".
if (isset($_POST['delete-image'])) {
}
"delete-image" should be set since that was the submit button I clicked. Why is PHP not picking up this posted varaible from this AJAX submit?