Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Droplist

Reply
Thread Tools

Droplist

 
 
Linda
Guest
Posts: n/a
 
      09-09-2008
Is there a way to have a blank line between each
<option>My Line</option>?

I have tried a <br> and <hr color="white"> and neither work.

Linda

 
Reply With Quote
 
 
 
 
Andy
Guest
Posts: n/a
 
      09-10-2008

"Linda" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a way to have a blank line between each
> <option>My Line</option>?
>
> I have tried a <br> and <hr color="white"> and neither work.
>
> Linda
>


Hi Linda,

This is how I do it...

<select>
<option>Red T-Shirt Small</option>
<option>Red T-Shirt Medium</option>
<option>Red T-Shirt Large</option>
<option>
<option>Green T-Shirt Small</option>
<option>Green T-Shirt Medium</option>
<option>Green T-Shirt Large</option>
<option>
<option>Blue T-Shirt Small</option>
<option>Blue T-Shirt Medium</option>
<option>Blue T-Shirt Large</option>
</select>

....this will put a blank line between the red, green and blue t-shirts in
the dropdown options list.

If you wanna finish it off a bit you could do this...

<select id="t-shirts" onChange="testforspace('t-shirts')">
<option>Red T-Shirt Small</option>
<option>Red T-Shirt Medium</option>
<option>Red T-Shirt Large</option>
<option>
<option>Green T-Shirt Small</option>
<option>Green T-Shirt Medium</option>
<option>Green T-Shirt Large</option>
<option>
<option>Blue T-Shirt Small</option>
<option>Blue T-Shirt Medium</option>
<option>Blue T-Shirt Large</option>
</select>

<script>
function testforspace(combo_id){
var spacertest =
document.getElementById(combo_id).options[document.getElementById(combo_id).options.selected Index].innerHTML;
if (spacertest==''){
alert('Please select a valid option from the dropdown menu list');
}
}
</script>

Hope this helps


Andy

 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      09-10-2008
Andy wrote:
>
> "Linda" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Is there a way to have a blank line between each
>> <option>My Line</option>?
>>
>> I have tried a <br> and <hr color="white"> and neither work.
>>
>> Linda
>>

>
> Hi Linda,
>
> This is how I do it...
>
> <select>
> <option>Red T-Shirt Small</option>
> <option>Red T-Shirt Medium</option>
> <option>Red T-Shirt Large</option>
> <option>
> <option>Green T-Shirt Small</option>
> <option>Green T-Shirt Medium</option>
> <option>Green T-Shirt Large</option>
> <option>
> <option>Blue T-Shirt Small</option>
> <option>Blue T-Shirt Medium</option>
> <option>Blue T-Shirt Large</option>
> </select>


Actually for that case OPTGROUP would serve the purpose semantically

<select name="t-shirts">
<optgroup label="Red T-Shirt">
<option value="redsm">Red T-Shirt Small</option>
<option value="redmd">Red T-Shirt Medium</option>
<option value="redlg">Red T-Shirt Large</option>
</optgroup>
<optgroup label="Green T-Shirt">
<option value="grnsm">Green T-Shirt Small</option>
<option value="grnmd">Green T-Shirt Medium</option>
<option value="grnlg">Green T-Shirt Large</option>
</optgroup>
<optgroup label="Blue T-Shirt">
<option value="blusm">Blue T-Shirt Small</option>
<option value="blumd">Blue T-Shirt Medium</option>
<option value="blulg">Blue T-Shirt Large</option>
</optgroup>
</select>

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
add validation to droplist control TJS ASP .Net 5 03-13-2005 04:11 AM
set selected value on a droplist TJS ASP .Net 2 03-10-2005 06:54 AM
reset selected index on droplist TJS ASP .Net 4 03-07-2005 04:38 AM
Filelist -> Droplist? Lasse Edsvik ASP .Net 1 10-04-2004 08:41 AM
Newbie Question about DropList and Page Load Meir Rotfleisch ASP .Net 2 11-02-2003 04:03 PM



Advertisments