Yup that worked after I got the scoping right

$('#myButton').click(function(){
   var validator = $("#myForm").validate();
   validator.settings.submitHandler = function() {alert('new
submithandler involed');};
});


Thanks Jorn.

Mark

On Mar 6, 12:39 pm, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:
> Try this:
>
> var validator = $("#myform").validate(...);
> $(".button").click(function() {
>   validator.settings.submitHandler = function() { ... };
>
> });
>
> Jörn
>
> On Fri, Mar 6, 2009 at 1:02 PM, Mark Perry <markperr...@googlemail.com> wrote:
>
> > Hi
>
> > This is a strange question I know but I would like to modify the
> > validate options to my form based on a click of a button. For example
> > my default onload code sets up the .validateI() class with my options
> > then based on a user clicking a button I want to override the
> > "submitHandler" options with some new code.
>
> > so in short:
>
> > $(document).ready(function(){
> >   $('#form').validate();
> > });
>
> > function changevalidateoptions()
> > {
> >  //Set my new options here
> > }
>
> > Thanks, Mark

Reply via email to