Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Design

<select> displaying extra row...

Author Message
Barcode



Joined: 02 Jun 2005
Posts: 16
Location: New York, NY

Posted: Mon Jun 27, 2005 - 9:40 pm    Post subject: <select> displaying extra row... Reply with quote

I am trying to get a <select> box that displays all three choices. I don't want the user to select multiple items. But I want them to see all three choices available to them.

Code:
<select id='ctrChoice' onchange='changeChoice ( this );' size=3>
   <option value=-1>Choice-1</option>
   <option value=0 selected>Choice0</option>
   <option value=1>Choice1</option>
</select>


The problem is that whenever this is displayed in a widget it shows a fourth row at the end. Is there some way I can force the <select> box to only show the three items and not the empty fourth row?

Thanks!
View user's profile Send private message Widgets
gnome
Administrator


Joined: 26 Sep 2004
Posts: 145

Posted: Tue Jun 28, 2005 - 9:34 am    Post subject: Reply with quote

<select id="ctrChoice" onchange="changeChoice ( this );" size="3" style="height: 4em;">
<option value=-1>Choice-1</option>
<option value=0 selected>Choice0</option>
<option value=1>Choice1</option>
</select>
View user's profile Send private message Widgets
cerberus



Joined: 20 Jun 2005
Posts: 118

Posted: Fri Jul 15, 2005 - 3:09 pm    Post subject: Reply with quote

I am curious why you are starting at "option -1" instead of 0... I have used the select tag for menus ( like the Apple "Voices" widget) and I start at option 0.. What happens when you start with -1 ?

cerberus
View user's profile Send private message Send e-mail Visit poster's website Widgets
Chris



Joined: 27 Jan 2005
Posts: 344
Location: Durham, UK

Posted: Fri Jul 15, 2005 - 5:00 pm    Post subject: Reply with quote

cerberus wrote:
I am curious why you are starting at "option -1" instead of 0... I have used the select tag for menus ( like the Apple "Voices" widget) and I start at option 0.. What happens when you start with -1 ?

cerberus


Huh? You can put anything you like in the value attribute - admittedly he should be enclosing the attribute's value with speech marks. When iterating through the options collection of the <select> then they do start at zero, but that's not relevant to what he's doing there. It might be, for example, for speaker balance, where you have -1 as the left, 0 as the middle and 1 as the right...
View user's profile Send private message Send e-mail Visit poster's website AIM Address Widgets
cerberus



Joined: 20 Jun 2005
Posts: 118

Posted: Fri Jul 15, 2005 - 8:26 pm    Post subject: Reply with quote

Chris wrote:
cerberus wrote:
I am curious why you are starting at "option -1" instead of 0... I have used the select tag for menus ( like the Apple "Voices" widget) and I start at option 0.. What happens when you start with -1 ?

cerberus


Huh? You can put anything you like in the value attribute - admittedly he should be enclosing the attribute's value with speech marks. When iterating through the options collection of the <select> then they do start at zero, but that's not relevant to what he's doing there. It might be, for example, for speaker balance, where you have -1 as the left, 0 as the middle and 1 as the right...


Oh cool.. Can you also make an array size start at a negative number so the default "item 0" can be any item in the array without needing to re-order the array ?

cerberus
View user's profile Send private message Send e-mail Visit poster's website Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group