A new idea came across my mind.Someone may have implemented this. I am trying to get a way to add a textbox inside a dropdown list.
Means I want to add a input box inside a dropdown list. For example :
<select id='country'>
<option value='USA'>USA</option>
<option value='UK'>UK</option>
<option value='Russia'>Russia</option>
<option><input type='text' /></option> // Here I want to add dynamic country
using ajax but I am able to render
this dropdown.
</select>
Does anyone have any idea on how to execute this? I do not want to use any modal box or input box outside this dropdown. I just want to add the value inside the dropdown and press the enter key to add in DB. I'm not worried about the server-side code. I want to be able to render the dropdown only.
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…