I am trying to update my database when the user clicks a certain link (links have different values, so when user clicks one link number goes up by 1, another by 2, and so on).
I need to submit a form to another page containing the data from #form with a variable behind it, but this function doesn't seem to be working.
JavaScript
function update_number(x) {
$.ajax({
type: "POST",
url: "update_likes.php",
data: $("#Form"+x).serialize(),
dataType: "json",
return false;
};
HTML
<input type='image' src='...' onclick'update_number(2);' />
Any help appreciated.