prakash.k Posted January 9, 2012 Share Posted January 9, 2012 I want my convert my dropdown list to text box when i change the dropdown list(ie onchange).Is there any HTML tag or Attribute to do so? help me Link to comment Share on other sites More sharing options...
regicidedelferoz Posted January 9, 2012 Share Posted January 9, 2012 post your existing code,. i may help. Link to comment Share on other sites More sharing options...
prakash.k Posted January 9, 2012 Author Share Posted January 9, 2012 Its Just a drop down list...There are around 10 values in dropdown.If i select any one in that the dropdown list it have to be converted into textbox.Thats... Link to comment Share on other sites More sharing options...
dsonesuk Posted January 9, 2012 Share Posted January 9, 2012 <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 More sharing options...
prakash.k Posted January 12, 2012 Author Share Posted January 12, 2012 Thank you dsonesuk.Can you help me in another thing? There is a drop down list.I have to use that as text box also. ie It have to work as a dropdown list and also text box at a time...Is this possible? Link to comment Share on other sites More sharing options...
dsonesuk Posted January 12, 2012 Share Posted January 12, 2012 ???? 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 More sharing options...
prakash.k Posted January 12, 2012 Author Share Posted January 12, 2012 Dsonesuk, people here saying this is possible in HTML5..There was some Tag for that...So only i am trying to find out.. Link to comment Share on other sites More sharing options...
dsonesuk Posted January 12, 2012 Share Posted January 12, 2012 You are talking about datalist tag http://www.w3schools.com/html5/tag_datalist.asp Note this currently only works for FF, and Opera Link to comment Share on other sites More sharing options...
prakash.k Posted January 13, 2012 Author Share Posted January 13, 2012 Yes...I got it...Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.