|
Posted by Brent Baisley on 09/28/34 11:33
You should have posted this to a javascript board, it has nothing to
do with PHP. That said, if the form field name contains special
characters, like [], you can reference it like this:
document.formname.elements['checkbox1[]'].
Use the elements[] reference style.
On Dec 1, 2005, at 12:42 PM, Kelly Meeks wrote:
> Hi all,
>
>
>
> I'm hoping someone can help me with this problem.
>
>
>
> I'm using javascript for some client side field validation in a form
> (method=post) that gets managed via php.
>
>
>
> This particular form makes extensive use of checkboxes. I've
> always like
> how when named properly (field name of "checkbox1[ ]"), php will
> pass that
> variable as an array that contains all the values selected in the
> form.
> Very handy. BUT,
>
>
>
> How do you then reference that variable via javascript to do any
> client-side
> validation? The code I use makes reference to the field's id, and
> it still
> doesn't seem to check things properly.
>
>
>
> Is there any way around this, or what am I missing?
>
>
>
> TIA,
>
>
>
> Kelly
>
>
> --
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
Navigation:
[Reply to this message]
|