$(document).ready(function() { ids = $('td.id').each(function(i) { var id = $(this).text() var estimationField = '' $('td.' + estimationField + ' span').eq(i).editable(function(value, settings) { var currentElement = this; $.ajax({ type: 'POST', url: 'xmlrpc', data: 'ticket.update' + '' + id + '' + '' + '' + estimationField + '' + '' + value + '' + ' ', contentType: 'text/xml', success: function(){ $(currentElement).text(value); } }); return('Saving...'); }, { tooltip : 'Click to edit...', placeholder: '', onblur : 'submit', select : 'true', style : 'inherit', width : 60 }); }); });