javascript - Can't Accept Text in jQuery Editable -
i using following create text field "ok" , "cancel" options entering new text:
$('.edit_area.entry').first().editable('ajax-save-entry.php', { type : 'textarea', cancel : 'cancel', submit : 'ok', indicator : '<img src="img/indicator.gif">', tooltip : 'click edit...' });
i have in html:
'<div id="' . $system->systemid . '" class="edit_area entry">' . $system->description . '</div>'
this ajax-save-entry.php:
<?php if(isset($_post['id'])){ $system = system::find_by_id($_post['id']); if($system){ $system->description = $_post['value']; $system->save(); echo $system->description; } else { echo "cannot find system system id"; } } else { echo "no system id set"; } ?>
i can type text , cancel it, clicking "ok" seems nothing. not sure if php code not running or if stopping before there. ideas?
edit: using this plugin.
if tell plugin you're using, optimal. i'm going assume you're talking this one
since it's popular/standard (i think).
anyway, thing you're missing callback function handle you're echoing onto php page.
$('.edit_area.entry').first().editable('ajax-save-entry.php', { type : 'textarea', cancel : 'cancel', submit : 'ok', indicator : '<img src="img/indicator.gif">', tooltip : 'click edit...', callback : function(data) { //the data variable whatever php script echoed } });
Comments
Post a Comment