开发者

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

开发者 https://www.devze.com 2023-04-04 10:56 出处:网络
I am usingjquery-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\']; ?></sp

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

精彩评论

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