Hi, there is a strong possibility that I'm just being stupid here as this is my first attempt at using jQuery's ajax functionality so please bear with me.
$(document).ready(function(){
$("input.update").click(function(){
var str = $(this).parent().serialize();
$(this).parent().parent().block({ message: "<span class=\"loading\"><img src=\"<?php echo $siteUrl ?>/admin/template/images/loading.gif\" alt=\"loading...\" /><p>Updating...</p></span>" });
$.ajax({
type: "POST",
url: "forms/update.php",
data: str,
success: function(){
$("div.edit_box").unblock();
$("div.edit_box").append("<span class=\"success\">This has been updated!</span>");
}
});
return false;
});
});
I have tried to get this working for a little while now and can't figure out why it doesn't pick up the form. All it does is just to do a normal php post without throwing any errors... Any help would be appreciated!
Forgot to add that I'm using blockUi on this as well, hence block/unblock.