<select multiple="multiple"></select>

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
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

<select multiple="multiple"></select>

Post by PHPycho »

Hello everybdoy..
i am using multple select i.e. <select multiple="multiple"></select>
for the first time as a replacement of checkbox..
My Questions?
1>how to insert the multiple selected values..?
2>how to auto select the multiple values...?
3>how to edit the multiple values..?
Any suggestion,advice,help...etc are warmly welcome!!
Anyway Thanks a lot
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: <select multiple="multiple"></select&

Post by Christopher »

PHPycho wrote:1>how to insert the multiple selected values..?
I usually make the select value an array and then implode() it.
PHPycho wrote:2>how to auto select the multiple values...?
Set all options that are selected to "selected="selected"". If you implode then explode() to get back to an array
PHPycho wrote:3>how to edit the multiple values..?
Not sure what you mean?
Last edited by Christopher on Wed Jan 24, 2007 2:10 pm, edited 1 time in total.
(#10850)
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Code: Select all

<select name="name" multiple="multiple">
 <option value="1" selected="selected">One</option>
 <option value="2" >two</option>
 <option value="3" >three</option>
 <option value="4" selected="selected">four</option>
 <option value="5" >five</option>
</select>
One question I have though... I know the size attribute controls how many rows to display, but what controls how many columns? (characters - like the equivalent of size attribute for text inputs)

EDIT: I didn't notice this was in the PHP - code forum... I assumed the OP was asking an HTML question.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

size and/or width
Post Reply