U need set the rules for your validation: frmSubmittal.validate({ debug: false, focusCleanup: false, focusInvalid: false, onfocusout: false, onkeyup: false, errorPlacement: function(error, element) { error.prependTo( element.parents("div.ctrlHolder")); }, errorElement:'div', errorClass:'valerror', rules:{ nameField:{ company:true } }
}); On Wed, Oct 21, 2009 at 22:04, JMan <jbeck...@gmail.com> wrote: > > what am I doing wrong here? I cannot figure out how to use the > addMethod(). > > var frmSubmittal = $("#frmSubmittal"); > > //validates the form > frmSubmittal.validate({ > debug: false, > focusCleanup: false, > focusInvalid: false, > onfocusout: false, > onkeyup: false, > errorPlacement: > function(error, element) {error.prependTo > ( element.parents("div.ctrlHolder"));}, > errorElement:'div', > > errorClass:'valerror' > > }); > > $.validator.addMethod( "company", function(value, element) {alert > ("hello"); return false;}, "Enter a Company Name" ); >