$ (function () { var rules = { "Coupon_amount": [/^0. ( [1-9]) {1,2}$/, "must be 0.85 such numbers"] } $.skygqcheckajaxform.addrules (rules); Second form validation var items_array2 = [ {name: ' info[login] ', type: "username", simple: "User name", message: "What the aircraft, well fill in the username", focusmsg: ' The combination of numbers and English and underline and., beginning with letters, 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: ' Username already exists '}, {name: ' Info[password] ', type: ' Password ', simple: ' Password ', focusmsg: ' min Length: 6 max Length: 16 '}, {name: ' Info[confirm_password] ', type: ' eq ', to: ' Info[password] ', simple: ' Confirm password ', focusmsg: ' Please re-enter the password you filled in '}, {name: "Info[email]", type: "Mail", simple: "Email", focusmsg: ' Please fill in the real and most used mailbox '}, {name: "Info[age]", Simple: "Age", between:[18,78],focusmsg: ' Age must be greater than or equal to 18 less than or equal to 78 '}, {name: "Info[do_years]", simple: "Working age", type: "GT", Value:3,focusmsg: ' must be greater than 3 '}, {name: "sport[]", Simple: "Motion", Checked_limit:[2,2],focusmsg: "Please select 2 Sports"}, {name: "favourite[]", Simple: "Hobby", checked_limit:[4,7],focusmsg: "Please choose 4 to 7 Hobbies"}, {Name: "Sky.zhekou", type: "Coupon_amount", Simple: "Discount", focusmsg: "Please fill in the discount factor"} ];
$ ("#form2"). Skygqcheckajaxform ({ Items:items_array2, Isajaxsubmit:true, Success:showresponse2, DataType: ' JSON ' }); function ShowResponse2 (responsetext, StatusText, XHR, $form) { Alert ("Registered successfully") Alert ("JSON return data is:" + responsetext); } }); |