javascript - How to add both toggle and validate options to x-editable? -


i use x-editable inline editor http://vitalets.github.io/x-editable/docs.html

i want toggle inline form other link:

$("#how").click(function(e) {   e.stoppropagation()   e.preventdefault()   $("#com").editable({     'toggle',     validate: function(value) {       if($.trim(value) == '') {         return 'the content can not blank!';       }     }   }) }) 

but not work, want know how pass both toggle , validate option.

seperate options declaration , 'toggle' part trick:

$("#how").click(function(e) {   e.stoppropagation();   e.preventdefault();   $("#com").editable({     validate: function(value) {       if($.trim(value) == '') {         return 'the content can not blank!';       }     }   });   $("#com").editable('toggle'); }); 

hope helpful others :)


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -