Jump to content

combobox how to show inputField


plodos

Recommended Posts

<center>
<form name="combowithtext">
<select name="example" size="1" onChange="showtext()">
<option value="AAA">AAA</option>
<option value="BBB">BBB</option>
<option value="CCC">CCC</option>
</select>

<input name="text" type="text" id="text" size="28"/>

<script language="javascript">
<!--
var shortcut=document.combowithtext
var descriptions=new Array()

descriptions[0]="aaa"
descriptions[1]="bbb"
descriptions[2]="ccc"

shortcut.text.value=descriptions[shortcut.example.selectedIndex]


function showtext()
{
shortcut.text.value=descriptions[shortcut.example.selectedIndex]
}
//-->
</script>

</form>
</center>

 

There will be only bombobox in the form, input field must be hidden, but i didnt do it :(

 

If the user select AAA from combobox, then input field will be visible with aaa text

 

If the user select BBB from combobox, then input field will be visible with bbb text

 

If the user select BBB from combobox, then input field will be visible with ccc text

------------------------------------------------------------------------------

I used disabled but I dont want that

<input disabled  name="text" type="text" id="text" size="28"/>

I need visible/hidden inputField

 

Pls help me...

Link to comment
https://forums.phpfreaks.com/topic/116663-combobox-how-to-show-inputfield/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.