remove the ok button in jeditable select

The default sample code for <select> in jeditable has an OK button. That ends up requiring one more click to pick a value from a dropdown.

1
2
3
4
5
 $('.editable').editable('http://www.example.com/save.php', { 
     data   : " {'E':'Letter E','F':'Letter F','G':'Letter G', 'selected':'F'}",
     type   : 'select',
     submit : 'OK'
 });

To take away that OK button, just take out that “submit” attribute. Magically, after picking a value from the dropdown the value gets updated. Kudos to the contributor who enabled this feature. 😉

1
2
3
4
 $('.editable').editable('http://www.example.com/save.php', { 
     data   : " {'E':'Letter E','F':'Letter F','G':'Letter G', 'selected':'F'}",
     type   : 'select'
 });

The hack mentioned in the following link is not applicable anymore, assuming you are using the latest version of jeditable.

http://stackoverflow.com/questions/1961383/is-there-anyway-to-in-jeditable-to-removing-submit-button-when-using-select

Leave a Reply

Your email address will not be published.