| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- $(function () {
- $("#form-holiday-add").validate({
- rules: {
- configKey: {
- required: true,
- minlength: 1,
- maxlength: 9,
- remote: {
- url: pagePath + "/super/isExistHoliday",
- type: "get",
- data: {
- configKey: function () {
- return $("#configKey").val();
- },
- id: function () {
- return $("#id").val();
- }
- }
- }
- },
- configName: {
- minlength: 1,
- maxlength: 20
- }
- },
- messages: {
- configKey: {
- remote: "该年份假日信息已存在!"
- }
- },
- onkeyup: false,
- focusCleanup: true,
- focusInvalid:false,
- success: "valid",
- submitHandler: function (form) {
- $(form).ajaxSubmit({
- type: 'post',
- url: pagePath + "/super/holiday/save",
- dataType: "json",
- success: function (data) {
- if (data.status == "success") {
- succeedMessage(data.message);
- setTimeClose();
- } else {
- // $(form).find(":submit").attr("disabled", false);
- errorMessage(data.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- return false; // 非常重要,如果是false,则表明是不跳转,在本页上处理,也就是ajax,如果是非false,则传统的form跳转。
- }
- });
-
- });
|