That's brilliant! I do appreciate your help, still mastering jquery.
It worked lovely though I had to append parenthesis to .val.
Is this supposed to work on all of the built in validation functions?
I've tried it on email and creditcard, but it doesn't seem to  apply
quite as well as it does on the maxlength field.

Steve

On Jun 24, 2:58 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Via the param property:
>
> maxlength: {
>   param: 5,
>   depends: function(element) { return jQuery("#textarea1").val ==
> 'buga' && jQuery("#textarea2").val != 'booga' }
>
> }
>
> Jörn
>
>
>
> On Tue, Jun 24, 2008 at 1:52 PM, Chandler <[EMAIL PROTECTED]> wrote:
>
> > Hi Jörn,
>
> > It sounds good, but how would I pass maxLength a value? i.e. max chars
> > of 5?
>
> > Steve
>
> > On Jun 20, 8:32 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > wrote:
> >> Give this a try:
>
> >> maxlength: {
> >>   depends: function(element) { return jQuery("#textarea1").val ==
> >> 'buga' && jQuery("#textarea2").val != 'booga' }
>
> >> }
>
> >> Jörn
>
> >> On Fri, Jun 20, 2008 at 7:20 PM,Chandler<[EMAIL PROTECTED]> wrote:
>
> >> > Hi all,
>
> >> > I'm just getting to grips with this Validation plug-in but would like
> >> > to check whether something is possible.
> >> > I would like to run validation on a field based on values from other
> >> > parts of the form.
>
> >> > I realise that this is possible with the required field, i.e.
>
> >> > required: function(element) { return jQuery("#textarea1").val ==
> >> > 'buga' && jQuery("#textarea2").val != 'booga' }
>
> >> > But this is also possible for the other functions? i.e. the same as
> >> > above but for maxLength?
>
> >> > maxLength: function(element) { return jQuery("#textarea1").val ==
> >> > 'buga' && jQuery("#textarea2").val != 'booga' }
>
> >> > The reason I ask is that I would like to apply validation but not
> >> > necessarily have the form field as mandatory.
>
> >> > Many thanks,
>
> >> > Steve- Hide quoted text -
>
> - Show quoted text -

Reply via email to