Rayna,

Check out qForms:
http://www.pengoworks.com/qForms/

It's a JavaScript framework for working w/forms. There isn't a built in
validation method for this, but here's one that'll work with qForms:

function _f_isCheckboxLenLT(len){
        _param(arguments[0], 5, "number");
        if( this.value.split(",").length >= len )
                this.error = "The " + this.description + " field must
have less than " + len + " values selected.";
}
_addValidator("isCheckboxLenLT", _f_isCheckboxLenLT);

Now all you'll need to do is attach the method to your form field:
o.fieldName.isCheckboxLenLT(5);

(Where "o" is the qForm object and "fieldName" is the name of the
checkbox field.)

-Dan


> -----Original Message-----
> From: Rayna Evans [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 4:01 PM
> To: CF-Talk
> Subject: javascript form help
> 
> does anyone know where i can find a script that will limit the user
from
> chosing more than a certain amount of choices in a checkbox form?  the
> user can only chose up to 5 choices, but there are many choices that
they
> can chose from.
> 
> any help would be greatly appreciated.
> 
> Rayna
> 
> Rayna Evans
> AAMC
> 2501 M Street, 2nd Fl
> Washington, DC 20037
> 202-862-6243 (direct)
> Extension 4243 (internal)
> 
> 
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to