It's my understanding that the validation plug-in listens for a form
to be submitted before performing its checks.  If this isn't the case
then this won't work, but, in your sample code you've used:
 validator.triggerHandler('submit');
which will need to be changed to:
 $('#formid').triggerHandler('submit');

Validator is the validate function itself and as far as i know does
not support a triggerHandler method, or a 'submit' event.  So this
rules needs to be applied to the form element itself.

JQuery has a nack for failing silently - good for production; bad for
development!

Friday has a nack for being lame - good for.. well.. nothing!

M


On Nov 7, 4:04 pm, Justin Kozuch <[EMAIL PROTECTED]> wrote:
> No joy there...
>
> Here's my code:
>
> // validate signup form on keyup and submit
>   var validator = $("#sourcing").validate();
>   $("#submit").click(function() {
>     validator.triggerHandler('submit');
>         rules: {
>         ....
>     }, // end rules
>
>     messages: {
>       ...
>     } // end messages
>     });
>   });
>
> });
>
> I'm not getting any JS errors, so I'm going to assume that everything
> is in order. However, validation still isn't occuring... Oh, how I
> love Fridays. ;)
>
> - justin
> On Nov 7, 10:47 am, mbraybrook <[EMAIL PROTECTED]> wrote:
>
> > Correction:
> >   validator.triggerHandler('submit');
> > change to
> >   $('#formid').triggerHandler('submit');
>
> > M
>
> > On Nov 7, 3:45 pm, mbraybrook <[EMAIL PROTECTED]> wrote:
>
> > > Try using the triggerhandler function:
> > > var validator = $("#sourcing").validate();
> > > $("#submit").click(function() {
> > >         validator.triggerHandler('submit');
>
> > > });
>
> > > Not tested...
>
> > > HTH
> > > M
>
> > > On Nov 7, 3:41 pm, Justin Kozuch <[EMAIL PROTECTED]> wrote:
>
> > > > Hi There,
>
> > > > I've been using the validation plug in for a while now and I love it,
> > > > but I am stuck on something.
>
> > > > I am trying to validate a form using:
>
> > > > <input type="button" id="submit" name="submit" value="Submit" />
> > > > instead of the usual:
>
> > > > <input type="submit" id="submit" name="submit" value="Submit" />
>
> > > > I tried using:
>
> > > > var validator = $("#sourcing").validate();
> > > > $("#submit").click(function() {
> > > >         validator.form();
>
> > > > });
>
> > > > to do the validation but that doesn't do anything at all. Has anyone
> > > > been able to figure this out?
>
> > > > Thanks,
>
> > > > Justin

Reply via email to