Jump to content

Dropdown List To Text Box


prakash.k

Recommended Posts

<script type="text/javascript">/*<![CDATA[*//*---->*/function terminate_ressurect_anew(elem){if(elem.value!=-9999){var elemId = document.getElementById(elem.id);var parentElement = elemId.parentNode;var elemValue = elemId.valueparentElement.removeChild(elemId);var inputBox = document.createElement("input");inputBox.id="inputtest";inputBox.name="inputtest";inputBox.type="text";inputBox.value=elemValue;parentElement.appendChild(inputBox);}}/*--*//*]]>*/</script>

<form id="myform" name="myform" action="#" method="post"><select id="myselect" name="myselect" onchange="terminate_ressurect_anew(this)"><option value="-9999">Select option</option><option value="op 1">option 1</option><option value="op2">option 2</option><option value="op3">option 3</option></select></form>

Link to comment
Share on other sites

???? A dropdown list works as dropdown list, and input text box works as input text box, they can only be one or the other, you can't mate them and make a hybrid of the two. What you can do is have a dropdownlist when an option is selected, update the value of a specific input text box somewhere on the same page.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...