php - jquery validation plugin -


Has anyone used this jquery plugin for form validation?

i cant use it Nothing says in the documentation how it gives the name of html form elements to work with the valet () method.

And the question 2 NRR, which php class validation is for the server side?

EDIT: Why does not this work:

  $ ("# register_box_form"). Validate ({Rule: {Name: {Required: Truth, Meanline: 3} Email: {Required: Truth, Meanline: 3, Email: True}}});  

& lt; Input type = "text" id = "email" name = "email" class = "required email" /> , in this code, the value 'required' and 'email' work for the class attribute are the same, because the document defines a valid method in the finished work. It means class = "required email" is equal,

  email: {required: true, email: true}  

In the above example I'll tell you what steps are necessary for jQuery validation (you can already know every step) to use jquery validation, first you have to include the main jquery library js file and jquery validation plugin js file Will happen. Then on the document on the prepared function, you must validate the work in the required form (as mentioned in the example above), you either declare the validation rules in this valid work or as the value of the class attribute of the corresponding input elements As I have described above. Sometimes I get problems when I use different values ​​for the input elements and the name attribute for the input elements does not know the reason for me, then try to give the same value for the ID and name attributes and check that Still not being verified.

You can use already verified verification rules such as email, url, number, number, etc. The rule is called "remote" which can be used to send an AJAX request and to verify in the server side. Apart from this, you can set custom rules according to your needs. For example, I use the following code to add a custom verification rule to keep the password in the correct password policy.

  $ Validator.addMethod ("passwd_policy", function (value, element, absolute) {this return element (element) || (value.length & gt; = 8 & amp; amp; /.[!,@,#,$ ,%, ^, & ,,,,,,,,,,, $$ = test (value) and amp; amp; amp; amp; amp; amp; amp; amp Amp; amp; amp; amp; amp; amp; amp; amp ;;;;;;;;;;;;;;;;;); ; Amp; amp; ;;;;;;;;;;;;;;;;;;; 0; asad ^ (); & amp;;, "Your password should be at least 8 characters long Must, at least one number, 
At least one upper letter "+" character
and at least one lowercase letter.);

you The term verification method can be added to validate a field by using inbuilt methods, which is similar to

  "txt_passwd": {passwd_policy: true},  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -