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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.