- $('#name').editable({
- type: 'text',
- title: 'Name',
- url: function () {
- return $.post('/echo/json/', {
- json: 'false',
- delay: .5
- });
- },
- pk: 123,
- validate: function (value) {
- if (value == 'bob') {
- return 'bob is not allowed';
- }
- },
- success: function (response) {
- if(response === false) {
- console.log('remote error from success');
- return 'remote error';
- }
- },
- error: function (response) {
- console.log('remote error from fail');
- return 'remote error';
- }
- });
转载请注明:谷谷点程序 » X-editable插件验证实例