最新消息: 新版网站上线了!!!

X-editable插件验证实例

  1. $('#name').editable({ 
  2.     type: 'text'
  3.     title: 'Name'
  4.     url: function () { 
  5.         return $.post('/echo/json/', { 
  6.             json: 'false'
  7.             delay: .5 
  8.         }); 
  9.     }, 
  10.     pk: 123, 
  11.     validate: function (value) { 
  12.         if (value == 'bob') { 
  13.             return 'bob is not allowed'
  14.         } 
  15.     }, 
  16.     success: function (response) { 
  17.         if(response === false) { 
  18.             console.log('remote error from success'); 
  19.             return 'remote error'
  20.         } 
  21.     }, 
  22.     error: function (response) { 
  23.         console.log('remote error from fail'); 
  24.         return 'remote error'
  25.     } 
  26. }); 

 

转载请注明:谷谷点程序 » X-editable插件验证实例