Web Development

General discussion


Using the "multiple" Value in a list box

By john ·
I have a database on a remote server, (SQL) which I populate by gathering data from an HTML form. I have a variable called Catagory that is a multiple select list. I am passing the information along to PHP-4 which in turn populates the database table. The issue is this. The HTML is only submitting the last selected item in the catagory even though i select three
items. I am under the assumption that I need to incorperate JAVASCRIPT to help me create a
comma dilineated string to then pass along to the php. Can anyone help me with this one.



This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Wish I could...

by tripcity In reply to Using the "multiple" Valu ...

I wish I could, although I just wanted to say I
wish these boards were more popular. Oh
well.. maybe some day...the people will come.

Have a good day.

Collapse -

here's the fix...

by talkingstone In reply to Using the "multiple" Valu ...

in you select tag in html, simply add the keyword "multiple" right inside the tag, not in quotes or anything. Then, when the form is submitted, pick up its value as an Enumeration;

example via jsp:
Enumeration enum = request.getParameter(selectBoxNameHere);

Hope it helps.

Related Discussions

Related Forums