javascript - using the jquery validation plugin, how can I add a regex validation on a textbox? -


I am using jquery validation plugin:

How do I add a regex check on a particular Can the text box?

I want to check to make sure the input is alphanumeric.

Define a new verification function, and use it in the rules of the field that you want to validate Are:

  $ (function () {$ .validator.addMethod ("loginRegex", function (value, element) {return.optional (element)} / ^ [a-z0-9 Valid: $ (i.e.EST);}, "Username must contain only letters, numbers, or dashes."); $ ("# Signupform") Validate ({Rules: {"Login": {Required: true, login rijx: true}}}, message: {"login": {Required: "You have a login name Must Rg "Login RegEx:" Log format is not valid "}}}})}};  

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -