scriptygoddess

07 Sep, 2008

jQuery Method for Validation Plugin – "field must include at least one number"

Posted by: Jennifer In: jquery

Here's a method you can use with the validation jQuery plugin to make sure a field (like a password field) includes at least one number.

$.validator.addMethod("atleastonedigit", function(pass) {
if (pass == "") {
return true;
}
return ((/[0-9]+/).test(pass));
}, "This field must contain at least one number");

Related posts:

  1. Multi-Row Carousel and Image Loader with JQuery A recent project I've been working on involved a portfolio...
  2. Delink Pages Plugin (Plugin and this post last updated: 10/20/2009 – Latest Plugin...
  3. Adding alternate row styles to a table with JQuery JQuery's simplicity is so wonderful and powerful. Here's a perfect...
  4. Multiple Featured Content Galleries On a site I was working on recently, the client...

Related posts brought to you by Yet Another Related Posts Plugin.

1 Response to "jQuery Method for Validation Plugin – "field must include at least one number""

1 | Fred Campbell

February 27th, 2009 at 8:57 am

Avatar

I am trying to find a way of having a pre determined series of passwords where you set the exact content – not just 1 number. Any ideas?

Comment Form

Featured Sponsors


  • Michael: You can use get_header(2) in your case. The filename of your custom header has to be header-2.php. The problem with include(your_file.php) is, all
  • cliff: hi wonder if you can help me, pls i designed www.kouga.mobi using dreamweaver CS3 and now want to make the phonenumbers into links so that if you
  • jerey: how do i rewrite this because it tried RewriteEngine on #Options +FollowSymlinks RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FIL

About


Advertisements