an easy question!!!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
skull cowboy
Forum Newbie
Posts: 14
Joined: Tue Jan 21, 2003 3:04 am

an easy question!!!

Post by skull cowboy »

Hi all,

I'm generating a page with php. In this page i'm including a form with a lot of checkbox, several of this checkbox are checked an others not. So, when i clicked on submit button, only take the value from the checked box previously. Anyone could tell me why don´t get the others values?
I only need determinate which of this checkbox are checked or not in the next php page.

thanks in advance.

sorry by my english.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

That's the way selected options are shipped via html/http, as name=On
If you want to get multiple option instances of the select-element use something like

Code: Select all

<select name="mySelect&#1111;]">
and you will get an array (with numerical indices) containing all checked options.
skull cowboy
Forum Newbie
Posts: 14
Joined: Tue Jan 21, 2003 3:04 am

thanks

Post by skull cowboy »

I´ll try with this.

Thanks.
skull cowboy
Forum Newbie
Posts: 14
Joined: Tue Jan 21, 2003 3:04 am

another solution?

Post by skull cowboy »

Ok, i tested your solution and it is ok, but it is possible to do the same thing with the checkbox control? Do you know another solution with chekbox control?

sorry, but i prefer use the checkbox control instead of select control for design reasons.

thanks again.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Please keep all questions related to one topic in the same thread. It gets messy if you open new threads relating to something you've already asked elsewhere.

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

almost the same

Code: Select all

<input name="myCheckbox&#1111;]" value="1" /><br />
<input name="myCheckbox&#1111;]" value="2" /><br />
<input name="myCheckbox&#1111;]" value="3" /><br />
<input name="myCheckbox&#1111;]" value="4" /><br />
I tried to explain it here: viewtopic.php?t=4396
Post Reply