contract_water_add.js 835 B

123456789101112131415161718192021222324
  1. $(function () {
  2. $("#form-content-add").validate({
  3. onkeyup:false,
  4. focusCleanup:true,
  5. success:"valid",
  6. submitHandler:function(form){
  7. $(form).ajaxSubmit({
  8. type: 'post',
  9. url: pagePath+"/build/water/saveContractWater",
  10. dataType:"json",
  11. success: function(result){
  12. if (result.success) {
  13. smileMessage(result.message);
  14. setTimeClose();
  15. } else {
  16. errorMessage(result.message);
  17. }
  18. }
  19. });
  20. return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
  21. }
  22. });
  23. });