# Specifying multiple for select

**URL:** <https://www.ruby-forum.com/t/specifying-multiple-for-select/97139>\
**Category:** Rails\
**Created:** [December 11, 2005, 11:51am UTC](https://www.ruby-forum.com/t/specifying-multiple-for-select/97139 "2005-12-11T11:51:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cool\_screen\_name900](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@cool\_screen\_name900](https://www.ruby-forum.com/u/cool_screen_name900)\
**Post date:** [December 11, 2005, 11:51am UTC](https://www.ruby-forum.com/t/specifying-multiple-for-select/97139/1 "2005-12-11T11:51:32Z")

</div>

With select(), how can I get it to just add ‘multiple’  
to the tag? Here’s what I’m doing:

select ‘obj’, ‘prop’, collection, {},  
{:multiple=\>true, :size=\>10}

which outputs:

I’d like it to look like this:

Possible?

thanks  
csn

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[Yahoo Mail - Organized Email](https://mail.yahoo.com)**
>
> It's time to get stuff done with Yahoo Mail. Just add your Gmail, Outlook, AOL or Yahoo Mail to get going. We automatically organize all the things life throws at you, like receipts and attachments, so you can find what you need fast. Plus, we've got...

---

<div class="post-metadata">

**Author:** ![cool\_screen\_name900](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@cool\_screen\_name900](https://www.ruby-forum.com/u/cool_screen_name900)\
**Post date:** [December 11, 2005, 6:44pm UTC](https://www.ruby-forum.com/t/specifying-multiple-for-select/97139/2 "2005-12-11T18:44:50Z")

</div>

On 11/12/2005, at 11:48 PM, CSN wrote:

> I’d like it to look like this:
> 
> Possible?

What’s wrong with multiple=“multiple”? It’s perfectly valid.

–  
Phillip H.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![cool\_screen\_name900](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@cool\_screen\_name900](https://www.ruby-forum.com/u/cool_screen_name900)\
**Post date:** [December 11, 2005, 8:30pm UTC](https://www.ruby-forum.com/t/specifying-multiple-for-select/97139/3 "2005-12-11T20:30:00Z")

</div>

— Phillip H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > which outputs:
> > 
> > I’d like it to look like this:
> > 
> > Possible?
> 
> What’s wrong with multiple=“multiple”? It’s  
> perfectly valid.

Uh, because the spec says ‘multiple’ not  
‘multiple=“multiple”’.

csn

> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[\[object](https://mail.yahoo.com/)**
>
> \[object

---

<div class="post-metadata">

**Author:** ![cool\_screen\_name900](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@cool\_screen\_name900](https://www.ruby-forum.com/u/cool_screen_name900)\
**Post date:** [December 11, 2005, 8:53pm UTC](https://www.ruby-forum.com/t/specifying-multiple-for-select/97139/4 "2005-12-11T20:53:42Z")

</div>

CSN wrote:

> — Phillip H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > > which outputs:
> > > 
> > > I’d like it to look like this:
> > > 
> > > Possible?
> > 
> > What’s wrong with multiple=“multiple”? It’s  
> > perfectly valid.
> 
> Uh, because the spec says ‘multiple’ not  
> ‘multiple=“multiple”’.

‘multiple’ is no valid X(HT)ML. Every attribute must have a value.

---

<div class="post-metadata">

**Author:** ![cool\_screen\_name900](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@cool\_screen\_name900](https://www.ruby-forum.com/u/cool_screen_name900)\
**Post date:** [December 11, 2005, 9:00pm UTC](https://www.ruby-forum.com/t/specifying-multiple-for-select/97139/5 "2005-12-11T21:00:04Z")

</div>

On 12/12/2005, at 8:27 AM, CSN wrote:

> Uh, because the spec says ‘multiple’ not  
> ‘multiple=“multiple”’.

It’s not valid XHTML. HTML 3 maybe, but all HTML parsers will accept  
multiple=“multiple”, plus you get XHTML compliance should you need  
it. Who looses here?

–  
Phillip H.  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![cool\_screen\_name900](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@cool\_screen\_name900](https://www.ruby-forum.com/u/cool_screen_name900)\
**Post date:** [December 11, 2005, 9:12pm UTC](https://www.ruby-forum.com/t/specifying-multiple-for-select/97139/6 "2005-12-11T21:12:10Z")

</div>

is valid HTML 4.01:  
[http://www.w3.org/TR/html4/interact/forms.html#h-17.6](http://www.w3.org/TR/html4/interact/forms.html#h-17.6)

But you two are correct, attributes must have values  
in XHTML:  
[http://www.w3.org/TR/xhtml1/#h-4.4](http://www.w3.org/TR/xhtml1/#h-4.4)

Well, as long as browsers can handle  
‘multiple=“multiple”’ and ‘selected=“selected”’ (which  
at least my Firefox and IE can)…

csn

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[\[object](https://mail.yahoo.com/)**
>
> \[object
