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

width of select tag...

Status
Not open for further replies.

fdgsogc

Vendor
Feb 26, 2004
160
CA
I am using a select tag to show Countries in a form.

I'd like the field to display the country code and only be the two characters wide. However, when the user selects the dropdown, I'd like the field to expand to display the actual country name.

This is what I have so far but seems I can't have my cake and eat it too.
Code:
	<select name="country" tabindex="6" style="width:50">
	<optgroup label="Select a country">
	<cfoutput query="getcountries">
	<option value="#id#">#countryname#</option>
	</cfoutput>
	</optgroup>
	</select>
 

Select box widths are determined by the content in most browsers. I don't think there is realistically anything you can do about this.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top