开发者

Not able to send correct ajax param data (using jquery-in-place-editor)

I am using jquery-in-place-editor for in-place updating a field.

the html markup for this is

<span class="profile-txt" id="editme1"><?php echo $_SESSION['pupil_postcode']; ?></span>

and the jquery used is

$("#editme1").editInPlace({
    value_required: true,
    url: "e开发者_如何转开发ditPupil.php",
    params:"postcode="+$("#editme1").html(),
    success: function(responseText){
        alert(responseText);
        //if(responseText=="Invalid Postcode"){
            //alert(responseText);
            //document.getElementById("editme1").innerHTML=postcode;
        //}
    }     
});

whenever I edit and enter the new value the ajax parameter still has the older values. for example the default value is ka10 7dw, if I change this to KA10 6DB, then also the postcode param takes the older value.


Try the below, and from this, just modify the code to suit yours.

$(document).ready(function(){
  $('#editme1').editInPlace({
    url: 'editPupil.php',
    field_type: 'text',
  });
});

And put in the editPupil.php:

echo $_POST['update_value'];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜