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!

text box on top of select box...

Status
Not open for further replies.

fdgsogc

Vendor
Feb 26, 2004
160
CA
I'm trying to simulate a combo dialog. I'm trying to do this by putting a text field on top of a select field. However, I just learned that a select field does not adhere to the z-index feature in CSS. Any way around this?

Here is my current failed example.
Code:
<script>
function popText(x) {
document.getElementById('textBox1').value=x;
}
</script>

<select name=fruits id=fruits onchange="popText(value);" style="width:200;z-index:10">
<option value="Bananas">Bananas</option>
<option value="Apples">Apples</option>
<option value="Oranges">Oranges</option>
<option value="Plums">Plums</option>
<option value="Grapes">Grapes</option>
<option value="Strawberries">Strawberries</option>
<option value="Blueberries">Blueberries</option>
</select>

<input type=text value='' id=textBox1 name=textBox1 style="width:180;position:relative;top:-40;left:-10;z-index:20">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top