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
Post a Comment