Page 1 of 1

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

Posted: Wed Jan 24, 2007 2:05 pm
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

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

Posted: Wed Jan 24, 2007 2:09 pm
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?

Posted: Wed Jan 24, 2007 2:09 pm
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.

Posted: Wed Jan 24, 2007 2:11 pm
by nickvd
size and/or width