Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Mootools Form.Validator checkbox

Received: by 10.52.67.145 with SMTP id n17mr5141733vdt.0.1324028444857;
        Fri, 16 Dec 2011 01:40:44 -0800 (PST)
X-BeenThere: clientside@googlegroups.com
Received: by 10.220.207.197 with SMTP id fz5ls2375485vcb.4.gmail; Fri, 16 Dec
 2011 01:40:44 -0800 (PST)
Received: by 10.52.29.227 with SMTP id n3mr5096949vdh.7.1324028444402;
        Fri, 16 Dec 2011 01:40:44 -0800 (PST)
Received: by 10.52.29.227 with SMTP id n3mr5096948vdh.7.1324028444392;
        Fri, 16 Dec 2011 01:40:44 -0800 (PST)
Return-Path: <ognen.plavev...@gmail.com>
Received: from mail-vw0-f61.google.com (mail-vw0-f61.google.com [209.85.212.61])
        by gmr-mx.google.com with ESMTPS id b8si2717329vdu.2.2011.12.16.01.40.44
        (version=TLSv1/SSLv3 cipher=OTHER);
        Fri, 16 Dec 2011 01:40:44 -0800 (PST)
Received-SPF: pass (google.com: domain of ognen.plavev...@gmail.com designates 209.85.212.61 as permitted sender) client-ip=209.85.212.61;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ognen.plavev...@gmail.com designates 209.85.212.61 as permitted sender) smtp.mail=ognen.plavev...@gmail.com
Received: by vbbfs19 with SMTP id fs19so1253213vbb.26
        for <clientside@googlegroups.com>; Fri, 16 Dec 2011 01:40:44 -0800 (PST)
MIME-Version: 1.0
Received: by 10.52.174.80 with SMTP id bq16mr924616vdc.11.1324028444312; Fri,
 16 Dec 2011 01:40:44 -0800 (PST)
Received: by z25g2000vbs.googlegroups.com with HTTP; Fri, 16 Dec 2011 01:40:44
 -0800 (PST)
Date: Fri, 16 Dec 2011 01:40:44 -0800 (PST)
In-Reply-To: <CAOdYwA0YSPtRp4_koiH24tyZ86padWZXVLGRWBw3F9iJQ_+T7g@mail.gmail.com>
References: <5078f1db-5f49-4129-8952-2f1e52ba0460@z17g2000vbe.googlegroups.com>
 <CAOdYwA0YSPtRp4_koiH24tyZ86padWZXVLGRWBw3F9iJQ_+T7g@mail.gmail.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2
 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2,gzip(gfe)
Message-ID: <d9298612-7e5f-4cd3-8b59-2c83be5d1805@z25g2000vbs.googlegroups.com>
Subject: Re: Mootools Form.Validator checkbox
From: electronbender <ognen.plavev...@gmail.com>
To: Clientcide <clientside@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Doh!

On Dec 16, 10:32=A0am, Aaron Newton <anut...@gmail.com> wrote:
> 1) general questions about MooTools should go to the MT users mailing lis=
t,
> not to Clientcide. Your answer a) may already be there (always search
> first!) and b) will help others if not.
>
> 2) your answer:http://mootools.net/docs/more/Forms/Form.Validator.Extras#=
Validators:...
>
> On Fri, Dec 16, 2011 at 1:27 AM, electronbender
> <ognen.plavev...@gmail.com>wrote:
>
>
>
>
>
>
>
> > I want to validate a checkbox. Actually multiple ones with one and
> > same name:
>
> > <input type=3D"checkbox" name=3D"somefield" value=3D"1">1
> > <input type=3D"checkbox" name=3D"somefield" value=3D"2">2
> > <input type=3D"checkbox" name=3D"somefield" value=3D"3">3
> > I want to make sure at least one box is checked before the form is
> > submitted.
>
> > So i've added a validator:
>
> > Form.Validator.add('isChecked', {
> > =A0 =A0errorMsg: 'One of these fields is required',
> > =A0 =A0test: function(element){
> > =A0 =A0 =A0 =A0if (element.type =3D=3D 'checkbox' || element.checked=3D=
=3Dtrue)
> > return false;
> > =A0 =A0 =A0 =A0else return true;
> > =A0 =A0}
> > });
> > But that requires all fields to be checked...
>
> > In the least case i want to pop out the same Form.Validator.Tips error
> > message (cant figure out how that is fired)...
>
> > So how do i go about dealing with this?
>
> > --
> > You received this message because you are subscribed to the Google Grou=
ps
> > "Clientcide" group.
> > To post to this group, send email to clientside@googlegroups.com.
> > To unsubscribe from this group, send email to
> > clientside+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/clientside?hl=3Den.