I just started picking up JQuery today, and for some reason I can't get this simple $.post to work when a form is submitted.
I want to pass the value of 2 as star to my PHP page "update_item.php".
I added an alert and saw that when I clicked submit it would give me the alert, but for some reason the value of 2 just doesn't pass to the php page.
Here's what I have with JQuery:
$('#form_edit_item').submit(
function(){
alert("submitting");
$.post(
"edititem.php",
{star: "2"},
);
});
Here's what I have in update_item.php:
$star = $_POST['star'];
echo "Star value: " .$star. "";
What am I doing wrong? Your help would be very much appreciated! Thanks!