$ (Function (){ Var rules = { "Coupon_amount": [/^ 0. ([1-9]) {0.85} $/, "must be a number like"] } $. SkygqCheckAjaxForm. addRules (rules ); // Verify the second form Var items_array2 = [ {Name: "info [login]", type: "username", simple: "username", message: ", please fill in the username", focusMsg: 'digits and English letters and underlines and. A combination of 4-20 characters, ajax: {method: 'post', url: base_url + 'skygq _ check_ajax_form_1_5/ajax.html ', success_msg:' congratulations! User name available ', failure_msg: 'user name already exists '}}, {Name: "info [password]", type: 'Password', simple: "password", focusMsg: 'Minimum length: 6 maximum length: 16 '}, {Name: "info [confirm_password]", type: 'eq ', to: 'info [password]', simple: "Confirm password", focusMsg: 'Enter your password again '}, {Name: "info [email]", type: "mail", simple: "Email", focusMsg: 'Enter the real and most common mailboxes '}, {Name: "info [age]", simple: "age", between: [], focusMsg: 'Age must be 18 or less than 78 '}, {Name: "info [do_years]", simple: "Service Life", type: "gt", value: 3, focusMsg: 'must be greater than 3 '}, {Name: "sport []", simple: "sport", checked_limit: [2, 2], focusMsg: "select 2 sports "}, {Name: "favorite []", simple: "hobbies", checked_limit: [], focusMsg: "select 4 to 7 hobbies "}, {Name: "sky. zhekou", type: "coupon_amount", simple: "discount", focusMsg: "Please fill in the discount coefficient "} ];
$ ("# Form2"). skygqCheckAjaxForm ({ Items: items_array2, IsAjaxSubmit: true, Success: showResponse2, DataType: 'json' }); Function showResponse2 (responseText, statusText, xhr, $ form ){ Alert ("registered successfully ") Alert ("JSON returned data:" + responseText ); } }); |