$_POST and multiselectable <select> tag

$_POST and multiselectable <select> tag

am 31.08.2007 17:59:46 von Zanna

Hi,

If I put in the code the tag









-----------------

If you select more that one item and press the submit button $_POST says the
first item selected... but the oters???
How can I know all the selected items???

Thanks

Re: $_POST and multiselectable <select> tag

am 31.08.2007 18:13:56 von ELINTPimp

On Aug 31, 11:59 am, "Fabio" wrote:
> Hi,
>
> If I put in the code the tag
>
>
>
>
>
>


>
>
>
> -----------------
>
> If you select more that one item and press the submit button $_POST says the
> first item selected... but the oters???
> How can I know all the selected items???
>
> Thanks

Do a search on this group for select+array

Re: $_POST and multiselectable <select> tag

am 31.08.2007 19:03:45 von Zanna

ELINTPimp wrote:

>
> Do a search on this group for select+array

Ok, I thank you to let me lost time searching for this *complex* solution
(ah, select+multiple, not select+array) that is

name="list[]"

and not

name="list"

Good, this works... also if the "[]" is not valid in html4 name attribute :)

http://www.w3.org/TR/html4/types.html#type-name

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
colons (":"), and periods (".").

Re: $_POST and multiselectable <select> tag

am 31.08.2007 20:08:46 von ELINTPimp

On Aug 31, 1:03 pm, "Fabio" wrote:
> ELINTPimp wrote:
>
> > Do a search on this group for select+array
>
> Ok, I thank you to let me lost time searching for this *complex* solution
> (ah, select+multiple, not select+array) that is

yes, well, teach a man to fish and all that...plus, the first thread
was the answer, so I have no remorse =)

Re: $_POST and multiselectable <select> tag

am 31.08.2007 22:01:43 von Zanna

ELINTPimp wrote:

>
> yes, well, teach a man to fish and all that...plus, the first thread
> was the answer, so I have no remorse =)

nor utility.

I'm programming and living NGs since 10 years: if I asked something that's
because I didn't find clear/secure asnswers on the web.

Thanks again for reply to me the same way as you replyed to other people in
the NG this day.

Re: $_POST and multiselectable <select> tag

am 31.08.2007 22:21:28 von Andy Hassall

On Fri, 31 Aug 2007 19:03:45 +0200, "Fabio" wrote:

>ELINTPimp wrote:
>
>> Do a search on this group for select+array
>
>Ok, I thank you to let me lost time searching for this *complex* solution
>(ah, select+multiple, not select+array) that is
>
>name="list[]"
>
>and not
>
>name="list"
>
>Good, this works... also if the "[]" is not valid in html4 name attribute :)

It is valid.

>http://www.w3.org/TR/html4/types.html#type-name
>
>ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
>by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
>colons (":"), and periods (".").

The name attribute is not of type NAME, see the DTD (and previous
discussions).

http://www.w3.org/TR/html4/interact/forms.html#adef-name-INP UT

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

Re: $_POST and multiselectable <select> tag

am 01.09.2007 14:23:52 von ELINTPimp

On Aug 31, 4:01 pm, "Fabio" wrote:
> ELINTPimp wrote:
>
> > yes, well, teach a man to fish and all that...plus, the first thread
> > was the answer, so I have no remorse =)
>
> nor utility.
My guidance gave you the soultion, yes?

>
> I'm programming and living NGs since 10 years: if I asked something that's
> because I didn't find clear/secure asnswers on the web.
>

I do not know your background, nor your experience level. However,
having seen this question numerous times in the past few months, I
wanted to provide an answer that would not only solve your problem but
also possible additional problems immediatly (you do have to wait for
a person to answer your question, but if a person searches and the
answer already exists, instant satifaction.

> Thanks again for reply to me the same way as you replyed to other people in
> the NG this day.

Yeah, I did feel a bit odd yesterday. I even went home early. I
apologize if I offended you or you felt that I didn't give you a solid
answer.

Re: $_POST and multiselectable <select> tag

am 01.09.2007 21:01:29 von Zanna

"Andy Hassall" ha scritto nel messaggio
news:cstgd3deiq9qg24enfr57nledbv4cn0bub@4ax.com...

>>Good, this works... also if the "[]" is not valid in html4 name attribute
>>:)
>
> It is valid.
>
>>http://www.w3.org/TR/html4/types.html#type-name
>>
>>ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
>>by any number of letters, digits ([0-9]), hyphens ("-"), underscores
>>("_"),
>>colons (":"), and periods (".").
>
> The name attribute is not of type NAME, see the DTD (and previous
> discussions).
>
> http://www.w3.org/TR/html4/interact/forms.html#adef-name-INP UT

???
this page tell exactly what I read:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
colons (":"), and periods (".").

so... NO "[]"

Re: $_POST and multiselectable <select> tag

am 01.09.2007 21:16:20 von Jerry Stuckle

Fabio wrote:
> "Andy Hassall" ha scritto nel messaggio
> news:cstgd3deiq9qg24enfr57nledbv4cn0bub@4ax.com...
>
>>> Good, this works... also if the "[]" is not valid in html4 name attribute
>>> :)
>> It is valid.
>>
>>> http://www.w3.org/TR/html4/types.html#type-name
>>>
>>> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
>>> by any number of letters, digits ([0-9]), hyphens ("-"), underscores
>>> ("_"),
>>> colons (":"), and periods (".").
>> The name attribute is not of type NAME, see the DTD (and previous
>> discussions).
>>
>> http://www.w3.org/TR/html4/interact/forms.html#adef-name-INP UT
>
> ???
> this page tell exactly what I read:
>
> ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
> by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
> colons (":"), and periods (".").
>
> so... NO "[]"
>
>
>

If that were the case, it wouldn't work, would it? But it does. On
every server, with every version of PHP, with every browser...

It does because you're looking at the wrong stuff. As Andy said, the
name attribute is not of type NAME. Look at the DTD.

Argue all you want. ELINTPimp and Andy gave you the correct answer.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: $_POST and multiselectable <select> tag

am 01.09.2007 21:17:27 von Michael Fesser

..oO(Fabio)

>???
>this page tell exactly what I read:
>
>ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
>by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"),
>colons (":"), and periods (".").

This section is about basic types in SGML. ID and NAME are _types_. The
name _attribute_ is usually of type CDATA, so '[]' are perfectly valid.

Micha