Thanks!
I did this so far:
jQuery.validator.addMethod("hasNumber", function(value,
element) {
return this.optional(element) ||
/\d/.test(value);
}, "Must contain a number.");
seems working for now but I check the password thing.
Luke
On Jan 15, 2009, at 1:25 PM, Jörn Zaefferer wrote:
digits requires digits only, eg. 123, number requires a decimal
number, eg. 500.1.
This extension might be a good starting point:
http://view.jquery.com/trunk/plugins/validate.password/
The password rules are a bit more complex and are rated, and the
rating is displayed. Take a look at the demo for the necessary markup.
If you can't use that as is, take a look at the password-method, that
should be a good starting point:
http://view.jquery.com/trunk/plugins/validate.password/jquery.validate.password.js
Jörn
On Thu, Jan 15, 2009 at 7:55 PM, Luke Adamis <lada...@ebeacon.com>
wrote:
Hello,
I need to validate password fields. I got this list of requirements
what a
password can be, among them: it has to contain numbers.
How can I validate if the password contains numbers or not.
I thought the built in numbers() method would do it for me. but it
seems it
requires the string to be all numbers. I thought the digit() would
require
all characters to be numbers and the numbers() would check if the
string has
numbers.
Thanks for help,
Luke