Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select form item - can there be categories?

Status
Not open for further replies.

emilybartholomew

Technical User
Aug 3, 2001
82
US
Hi-

I was wondering if there's a way to break a select item down into categories, like this:

Video
TV
VCR
Home Video Theater
Audio
CD player
Tape Player
.
.
.

It doesn't really matter if the category values are selectable or not.

Thanks-
 
Sure, just put spaces in your options:

<select name=&quot;type&quot; size=1>
<option value=&quot;Video&quot;>Video</option>
<option value=&quot;Video|TV&quot;>&nbsp;&nbsp;&nbsp;TV</option>
<option value=&quot;Video|VCR&quot;>&nbsp;&nbsp;&nbsp;VCR</option>
<option value=&quot;Video|Home Video Theater&quot;>&nbsp;&nbsp;&nbsp;Home Video Theater</option>
<option value=&quot;Audio&quot;>Audio</option>
<option value=&quot;Audio|CD Player&quot;>&nbsp;&nbsp;&nbsp;CD Player</option>
<option value=&quot;Audio|Tape Player&quot;>&nbsp;&nbsp;&nbsp;Tape Player</option>
</select>

I put in things like &quot;Video|TV&quot; so you could break the value up in your form processing script so you would know the category and subcategory. Hope that helps!
 
Okay, I put in ASCII spaces, like

[ampersand]nbsp[semi-colon]

But they didn't show up! Just put in a few of those before your text between the option tags.
 
Maybe a minus-sign will help to see more difference?

<option value=&quot;Video|TV&quot;>&amp;nbsp;[red]-[/red]&amp;nbsp;&amp;nbsp;TV</option>

Erik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top