Thursday 15 April 2010

jquery - HTML + Add input field inside a dropdown box -


There was a new idea in my mind. Someone may have implemented this, I'm trying to get a way to add a text box inside a dropdown list.

This means I want to add an input box inside a dropdown list. For example:

  & lt; Select ID = 'country' & gt; & Lt; Option value = 'USA' & gt; USA & lt; / Options & gt; & Lt; Option value = 'UK' & gt; Britain & lt; / Options & gt; & Lt; Option value = 'Russia' & gt; Russia & lt; / Options & gt; & Lt; Options & gt; & Lt; Input type = 'text' / & gt; & Lt; / Options & gt; // Here I want to add a dynamic country using Ajax but I am able to render this dropdown. & Lt; / Select & gt; Do anyone know how to execute it? I do not want to use any model box or input box outside this dropdown. I just want to add value to the dropdown and press Enter to add it to DB. I'm not worried about the server side code, I just want to be able to render the dropdown.  

Thanks in advance.

No. you can not do this. No other elements can be other than text content.

You may want to see some custom plugins instead, or create your own to render the devils / spans from the selection you provide.

Blockquote>

The text with the remaining characters (e.g. An example

  $ ('$') using the dropdown of   

You can customize and style as you wish.

.dropdown-menu li '). Click (function () ($. (Dropdown-toggle b). Remove (). AppendTo ($ ('dropdown-toggle'). Text ($ (this) .text)));});

No comments:

Post a Comment