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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

choices in a combo box

Status
Not open for further replies.

scroce

MIS
Joined
Nov 30, 2000
Messages
780
Location
US
I have a combo box that I want to appear blank on the inital page load. I did this by:

<SELECT> name=&quot;cboMyCombo&quot;</SELECT>
<OPTION> value=&quot;&quot;&quot;&quot;>&nbsp&nsbp</OPTION>
<OPTION>AA</OPTION>
<OPTION>AB</OPTION>
<OPTION>AC</OPTION>
Etc.....

and I put some javascript in the form that won't allow the user to submit a blank, BUT......

when you click on the down arrow, the first option shows a blank, a non-crucial but somewhat annoying flaw.

Does anyone have a suggestion or sample on how I might make the combo box show up initially blank, but then have no blank show up as a choice in the dropdown?



How much more water would there be in the ocean if it weren't for sponges?
 
Why not try this:

SELECT> name=&quot;cboMyCombo&quot;</SELECT>
<option value=&quot;Enter&quot;>Enter</option>
<OPTION>AA</OPTION>
<OPTION>AB</OPTION>
<OPTION>AC</OPTION>
Etc.....

This way the first choice informs the user to select a choice from the drop-down...
I'm not sure that you can have the no blank show-up when its dropped down... I have not failed; I merely found 100,000 different ways of not succeding...
 
that's what I thought - it's just the way html works I'll try your suggestion. How much more water would there be in the ocean if it weren't for sponges?
 
<OPTION value=&quot;&quot;></OPTION>

will work -- you had an extra '>' in there, too. Just leave the area between the opening and closing <option> tags blank, and the option will be blank.

:-)
Paul Prewett
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top