I'm using this code to submit a hidden form from a link:
Code:
$("#request").submit(function () {
$.ajax({
type: "POST",
cache: false,
url: "forms/add.php",
data: $(this).serialize(),
success: function (data) {
$('#result').html(data);
}
});
return false;
});
$("#request-link").live("click", function () {
$("#request").submit();
});
Is there anyway to combine it into one command instead of having the seperate statements? Thanks ...