By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,406 Members | 1,504 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,406 IT Pros & Developers. It's quick & easy.

Retrieving full entry from multiple select list

P: n/a
I have a list box with multiple selects. I define the name as numList[]. I
get the values from

$picked = $_POST['numList'];

It retrieves values for all those selected.

If the entries are, say,
First
Second
Third

and the first and third are select then $picked[0] has "First" and
$picked[1] has "Third".
If, however, the entries are:

First one
Second one
Third one

Then the values are for $picked[0] and $picked[1] are "First" and "Third"
respecticely.
How do I retrieve the entire value and not just the first word?

Shelly
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a


Shelly wrote:
If, however, the entries are:

First one
Second one
Third one

Then the values are for $picked[0] and $picked[1] are "First" and "Third"
respecticely.
How do I retrieve the entire value and not just the first word?


How are you determining what is in each entry?

If you do a
<?
echo '<pre>';print_r($_POST);echo '</pre>';
?>
after entering your processing script, what do you see?

Ken

Jul 17 '05 #2

P: n/a

"Ken Robinson" <ke******@rbnsn.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...


Shelly wrote:
If, however, the entries are:

First one
Second one
Third one

Then the values are for $picked[0] and $picked[1] are "First" and "Third"
respecticely.
How do I retrieve the entire value and not just the first word?
How are you determining what is in each entry?


$picked = $_POST['numList'];
If you do a
<?
echo '<pre>';print_r($_POST);echo '</pre>';
?>
after entering your processing script, what do you see?
I see:
Array
(
[numList] => Array
(
[0] => First
[1] => Third )

[filename] =>
[description] =>
[submit] => Delete Entries
)

Ken

Jul 17 '05 #3

P: n/a


Shelly wrote:
"Ken Robinson" <ke******@rbnsn.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...


Shelly wrote:
If, however, the entries are:

First one
Second one
Third one

Then the values are for $picked[0] and $picked[1] are "First" and "Third"
respecticely.
How do I retrieve the entire value and not just the first word?


How are you determining what is in each entry?


$picked = $_POST['numList'];
If you do a
<?
echo '<pre>';print_r($_POST);echo '</pre>';
?>
after entering your processing script, what do you see?


I see:
Array
(
[numList] => Array
(
[0] => First
[1] => Third )

[filename] =>
[description] =>
[submit] => Delete Entries
)


So what you see is what you got.

Next question: what does your form look like?

Ken

Jul 17 '05 #4

P: n/a

"Ken Robinson" <ke******@rbnsn.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...


Shelly wrote:
"Ken Robinson" <ke******@rbnsn.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
>
>
> Shelly wrote:
>> If, however, the entries are:
>>
>> First one
>> Second one
>> Third one
>>
>> Then the values are for $picked[0] and $picked[1] are "First" and
>> "Third"
>> respecticely.
>> How do I retrieve the entire value and not just the first word?
>
> How are you determining what is in each entry?


$picked = $_POST['numList'];
> If you do a
> <?
> echo '<pre>';print_r($_POST);echo '</pre>';
> ?>
> after entering your processing script, what do you see?


I see:
Array
(
[numList] => Array
(
[0] => First
[1] => Third )

[filename] =>
[description] =>
[submit] => Delete Entries
)


So what you see is what you got.

Next question: what does your form look like?


The list show:

First one
Second one
Third one

Shelly
Jul 17 '05 #5

P: n/a


Shelly wrote (in part):
Next question: what does your form look like?


The list show:

First one
Second one
Third one


No, what I mean is how are you defining your form, i.e. the HTML code.

Ken

Jul 17 '05 #6

P: n/a
Looks like someone forgot to put quotation marks around the value
attribute in the option tag...

Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.