jQuery: The Write Less, Do More JavaScript Library

 « Return to Thread: .post

.post

by arcticsoft :: Rate this Message:

Reply to Author | View in Thread

I am using the .post ajax method on a form. I use the following jquery code:

$("form#changeinfo").submit(function(){
$.post("ownerdetails.php", {
name: $("#name").val() });
});

So when the form with the id of changeinfo is submitted it posts information to ownerdetails.php. But when I write my php in ownerdetails.php and try to get the value of name it doesnt work. my php is simple just to test:

$name = $_POST['name'];
echo $name;

This does nothing even though there is a value in the field. Its as if nothing is posted to the server. Any ideas?
         

 « Return to Thread: .post

LightInTheBox - Buy quality products at wholesale price