[thelist] Re: Re: Checkboxes and the ASP Form collection

Ben Gustafson Ben_Gustafson at lionbridge.com
Fri Feb 8 11:50:01 CST 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
> > I'm writing an ASP script to do dynamic server-side form
> > validation. I'm having a problem with checkboxes and
> > radio buttons. If they are not checked, they do
> > not get into the Form collection.

> One way to quickly get around it is to put a hidden field in your form
> that has the same name as your checkboxes.  That way the field is sent
> regardless of whether or not the user checked any radio buttons or
> boxes. This method starts to break down if you use Javascript to
> modify those fields on the client side, but for the most part
> is pretty durn effective.
>
> HTH
>
> AJ

Cool! That works. The only side-effect I noticed is that there is a trailing
comma inserted at the end of (if the hidden field comes after the
checkboxes) the string requested from the checkbox. Other than that, seems
fine. Thanks for the tip, Aaron.

--Ben



More information about the thelist mailing list