I am submitting to a function instead of url. This function makes an ajax
request. If server cannot save the edited data or some other error. It will
return "ErRoR" in the string. I check if there is "ErRoR" text in the return
string I am displaying an message box.

Now i want the edit form to be visible with textbox containing the value
entered by the user. Now if the user hits cancel or hits escape it should
revert back to the original value. 

Below is the my code.


$('.edit').editable(function(value, settings){  
                
        $.ajax({
                type: 'POST',
                url: 'save.html',
                async: false,
                success: function(data){
                        if (/ErRoR:/.test(data))
                        {
                                data = data.replace(/ErRoR:/g, '');             
                
                                alert(data + ' Could not save data.');
                                //Back to edit
                        }                       
                }
        });
        return(value);
        }, {
         indicator : 'Saving...',
         width     : '170px',
         cssclass  : 'inlineEdit',
         cancel    : ' # Cancel ',
         submit    : '<br><input type="button" value="Save">',   
 });
-- 
View this message in context: 
http://www.nabble.com/jEditable-question-tp6969445s27240p19145897.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to