The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> i don't know how to see the values i select in a list form
mobutu_LM2006
post Sep 29 2006, 06:38 AM
Post #1





Group: Members
Posts: 1
Joined: 29-September 06
Member No.: 271



I want to see the values wich i select in a list form.

The code is :
"
<select name="categoria_insert" size="3" id="categoria_insert">
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
<option>E</option>
</select>
"

If i select options 'A' and 'D', for example, the value posted in $_POST['categoria_insert'] when i push the submit button is only 'D', not 'A' and 'D'.

Help me please.
Thank you.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post Sep 29 2006, 07:29 AM
Post #2


Programming Fanatic
********

Group: Members
Posts: 5,146
Joined: 23-August 06
From: Europe
Member No.: 9



Then I don't think you need a select menu but checkboxes.
See http://htmlhelp.com/reference/html40/forms/input.html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Sparkyg
post Sep 29 2006, 07:51 AM
Post #3


Member
***

Group: Members
Posts: 46
Joined: 29-September 06
From: Suffolk UK
Member No.: 270



Hi there

the values will be in an array, try the code below


for($i=0;$i<sizeof($_POST['categoria_insert']);$i++)
{

echo $_POST['categoria_insert'][$i];

}

cheers

Sparky
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Sparkyg
post Sep 29 2006, 09:13 AM
Post #4


Member
***

Group: Members
Posts: 46
Joined: 29-September 06
From: Suffolk UK
Member No.: 270



And the select statement should be as below

<select Name="categoria_insert[]" multiple>

best wishes

Sparkry
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Sep 29 2006, 11:19 AM
Post #5


.
********

Group: WDG Moderators
Posts: 8,044
Joined: 10-August 06
Member No.: 7



Also, with a MULTIPLE SELECT menu the Windows* user must hold Crtl down while selecting separate items (say item #1 and #3 but not #2). Most likely many users don't know about this functionality (and must be told on the web page).

*Don't know how it's done on a Mac.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jimlongo
post Sep 29 2006, 11:38 AM
Post #6


This is My Life
*******

Group: Members
Posts: 1,125
Joined: 24-August 06
From: t-dot
Member No.: 16



QUOTE(Christian J @ Sep 29 2006, 12:19 PM) *

Also, with a MULTIPLE SELECT menu the Windows* user must hold Crtl down while selecting separate items

*Don't know how it's done on a Mac.


*Probably Command (apple key), either side of the spacebar
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd February 2019 - 10:31 PM