Go Back   Forum Care Forums > Development Reference Area > Php Development

Reply
 
LinkBack Thread Tools Display Modes
checkboxes problem
Old
  (#1)
blueboy
Guest
 
Posts: n/a
Default checkboxes problem - 06-02-2007, 08:56 PM

Hi,

I have a checkbox array (about 20 lines)

input name=\"box\" type=\"checkbox\" value=\"$id\">
input name=\"box\" type=\"checkbox\" value=\"$id\">
input name=\"box\" type=\"checkbox\" value=\"$id\">

I do some client side checking with javascript however the javascript array

name=\"box\"

does not match the php version,

name=\"box[]\"

So either my client side stuff works or the php array only returns 1 value
when posted. Is there any way to for this to work?


R.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: [PHP] checkboxes problem
Old
  (#2)
Guest
Guest
 
Posts: n/a
Default Re: [PHP] checkboxes problem - 06-02-2007, 08:56 PM

2007. 05. 30, szerda keltezéssel 09.59-kor blueboy ezt ÃÂ*rta:
> Hi,
>
> I have a checkbox array (about 20 lines)
>
> input name=\"box\" type=\"checkbox\" value=\"$id\">
> input name=\"box\" type=\"checkbox\" value=\"$id\">
> input name=\"box\" type=\"checkbox\" value=\"$id\">


input name=\"box[]\" type=\"checkbox\" value=\"$id\">

greets
Zoltán Németh

>
> I do some client side checking with javascript however the javascript array
>
> name=\"box\"
>
> does not match the php version,
>
> name=\"box[]\"
>
> So either my client side stuff works or the php array only returns 1 value
> when posted. Is there any way to for this to work?
>
>
> R.
>

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: [PHP] checkboxes problem
Old
  (#3)
Richard Lynch
Guest
 
Posts: n/a
Default Re: [PHP] checkboxes problem - 06-02-2007, 08:56 PM



On Wed, May 30, 2007 3:59 am, blueboy wrote:
> Hi,
>
> I have a checkbox array (about 20 lines)
>
> input name=\"box\" type=\"checkbox\" value=\"$id\">
> input name=\"box\" type=\"checkbox\" value=\"$id\">
> input name=\"box\" type=\"checkbox\" value=\"$id\">
>
> I do some client side checking with javascript however the javascript
> array
>
> name=\"box\"
>
> does not match the php version,
>
> name=\"box[]\"
>
> So either my client side stuff works or the php array only returns 1
> value
> when posted. Is there any way to for this to work?


Let PHP use the NAME= attribute, and JS use the ID= attribute

name="box[1]" id="box1"

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top