0

hi everyone im new in ajax and i currently studing ajax.
my problem is

$('#current').click(function()
        {
                var id = $(this).attr("id");
                var sellitem=$('#spid').val();

                $.ajax(
                {
                       type: "POST",
                       url: "updatecurrentsp.php",
                       data:{
                       'itemid' : id ,'sellitem' : sellitem
                       }, 



                       success: function(data)
                       {
                     $('#sellprice').css("display","block");  //Changes the style of table from display:none to display:block
                            $('#sellprice').html(data);
                            alert(data);



                       }
                 });

my ajax runs perfectly but in my php

 echo $getid=$_REQUEST['itemid']; // this works fine
 echo $spid=$_REQUEST['sellitem']; // this returns undefine 'sellitem'

any advice is much more appreciated

Edited by israillaky

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by pritaeas
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.