Yes, I added the method, this is what I have now

// JS

$(document).ready(function(){
    jQuery.validator.addMethod("password", function( value, element,
param ) {
        return this.optional(element) || value.length >= 6 && /
\d/.test(value) && /[a-z]/i.test(value);
    }, "Your password must be at least 6 characters long and contain
at least one number and one character.");


    var container = $('#error_container');


    $("#reg_form").validate({
        errorContainer: container,
        errorLabelContainer: $("ol", container),
        wrapper: 'li',
        meta: "validate_reg_form",
        event: "keyup"
    });  // end validate

)};// end document ready



// HTML

<div id="error_container" class="error_container" >
                        Error:<br />
                        <ol>

                            <li><label for="password1"
class="error">Please enter a password, alphanumeric bla, blah</label></
li>
                            <li><label for="password2"
class="error">The passwords must match! Auf Deutsch</label></li>
                        </ol>
                </div>

<label for="password1">Passwort:</label>
<input id="password1" type="password" name="password1"
class="{validate_reg_form:{required:true, password:true}}">

<label for="password2">Passwort wiederholen:</label>
<input id="password2" type="password" name="password2"
class="{validate_reg_form:{required:true, equalTo:'#password1'}}">


On Sep 24, 7:53 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> voltron schrieb:> Hi Jörn, I have just tested your suggestion. Sadly, it does 
> not work,
> > if I add "password:true to my HTML, I get this:
>
> > jQuery.validator.methods[rule.method] has no properties
> >http://localhost/de/js/jquery.validate.pack.js
> > Line 14
>
> > I am following the example on your page, the one with the separate
> > errorContainer . I´m using the metadata plugin in conjunction with the
> > validation plugin.
>
> Have you added the password method? This one:
>
> jQuery.validator.addMethod("password", function( value, element, param ) {
>     return this.optional(element) || value.length >= 6 &&
> /\d/.test(value) && /[a-z]/i.test(value);}, "Your password must be at least 6 
> characters long and contain at least one number and one character.");
>
> -- Jörn

Reply via email to