Output value submitted to jeditable
Hi all,
I have just started using jquery and am impressed so far.
I am using jeditable to edit values in place, and submitting the values to a coldfusion page to update the values in the database. All this works fine. I am having a problem with the new (just submitted and updated) value being shown in the page.
What would be the best way to achieve this? A request to the db to get the new value or just outputting the value that was just submitted?
A sample of my code is below.
Thanks in advance.
-
$(document).ready(function() {
//$('.edit').editable('http://www.example.com/save.php');
$('.edit_area').editable('http://element/admin/gallery/update-gallery.cfm', {
cssclass : 'edit_textarea',
type : 'textarea',
cancel : 'Cancel',
submit : 'Save',
indicator : '<img src="img/indicator.gif">',
tooltip : 'Click to edit...',
onblur : 'ignore'
});
});
<table id="table-1" cellspacing="0" cellpadding="2">
<cfoutput query="galleryImages"><tr id="#gId#">
<td width="156"><img src="/assets/img/gallery/#gPath#" alt="thumbnail" title="#gDescription#" /></td>
<td valign="top">
<div class="edit_area" id="div_#gId#">#trim(gDescription)#</div>
</td></tr>
</cfoutput>
</table>
(Which outputs)
<table id="table-1" cellspacing="0" cellpadding="2">
<cfoutput query="galleryImages">
<tr id="1">
<td width="156"><img src="/assets/img/gallery/pic1.jpg" alt="thumbnail" title="description 1" /></td>
<td valign="top">
<div class="edit_area" id="div_1">description 1</div>
</td>
</tr>
<tr id="2">
<td width="156"><img src="/assets/img/gallery/pic2.jpg" alt="thumbnail" title="description 2" /></td>
<td valign="top">
<div class="edit_area" id="div_2">description 2</div>
</td>
</tr>
<tr id="3">
<td width="156"><img src="/assets/img/gallery/pic3.jpg" alt="thumbnail" title="description 3" /></td>
<td valign="top">
<div class="edit_area" id="div_3">description 3</div>
</td>
</tr>
</cfoutput>
</table>