Jörn

marketo form accepts a password with 6 numbers. But rule for that require
numeric and letters, right? Could be a bug?

Cheers

2007/9/22, Jörn Zaefferer <[EMAIL PROTECTED]>:
>
>
> voltron schrieb:
> > Hi,
> >
> > has anyone written a validator to check for alphanumeric values and a
> > min length for the validator plug in?
> >
> Take a look at this demo:
> http://dev.jquery.com/view/trunk/plugins/validate/demo-test/marketo/
> It uses a custom method for the password, you can find it right at the
> top here:
>
> http://dev.jquery.com/view/trunk/plugins/validate/demo-test/marketo/mktSignup.js
>
>         jQuery.validator.addMethod("password", function( value, element,
> param ) {
>                 var result = this.optional(element) || value.length >= 6
> && /\d/.test(value) && /\w/.test(value);
>                 if (!result) {
>                         element.value = "";
>                         var validator = this;
>                         setTimeout(function() {
>                                 validator.blockFocusCleanup = true;
>                                 element.focus();
>                                 validator.blockFocusCleanup = false;
>                         }, 1);
>                 }
>                 return result;
>         }, "Your password must be at least 6 characters long and contain
> at least one number and one character.");
>
> -- Jörn
>

Reply via email to