Jeditable setting default selected value after change.

Posted by Dk589 on Stack Overflow See other posts from Stack Overflow or by Dk589
Published on 2009-05-30T01:37:02Z Indexed on 2010/04/08 0:03 UTC
Read the original article Hit count: 406

Filed under:
|

My app allows the user to update a field via a drop down box using jeditable. When the program is loaded i created this function to get the selected value and set it as the selected value in jeditable.

But after i change the value, the selected tag stays set as the old value. how can i make it change to the new value?

this is the function

function updateType(ID,type){
$(document).ready(function(){

    $('#tweekType-'+ID).editable("edit.php?type=tweekType", {  

    data   : " {'copywriting':'Copywriting','design':'Design','code':'Code', 'selected':'"+type+"'}",
    type   : 'select'

    });
});

this is the wrapper around the tag.

<span id="tweekType-<?php echo $getTweaksReturned->tweekID; ?>">
<?php type($getTweaksReturned->type); ?>
<script>updateType('<?php echo $getTweaksReturned->tweekID; ?>','<? echo $getTweaksReturned->type; ?>'); </script>
</span>

The same tag is replicated on the page the returns the new variable.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jeditable