Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Drop Down Menu/Text Field in one

I'm working on building new site, and I need a drop down menu to select the amount of something in my site. But at the same time I need this drop down list to accept text. So if the client wants to choose from the drop down list then he can, also if the client want to enter the amount by text then he can also. As you can see I want to make it dual.

For example: suppose there is an amount drop down menu, and its elements are (1,2,3);

Suppose now that the client needs the amount to be 5 - this is his right - it does not exist in the drop down list, so the client now must enter the amount textually. So for any entry the client must either choose from the drop down list or enter the amount textually.

After the description of my problem, and the simple example that I have introduced to you, here is my question:

Is there HTML code to make a drop down menu and a text field in one, as dual, not separated?

like image 990
khalid jarrah Avatar asked Aug 19 '13 08:08

khalid jarrah


People also ask

How do I activate a TextBox if I select an option in drop down box?

When an item (option) is selected in DropDownList (HTML SELECT), the EnableDisableTextBox JavaScript function is executed. Inside this function, based on whether the Other option (item) is selected, the TextBox will be enabled else disabled. The HTML Markup consists of a DropDownList (HTML SELECT) and a TextBox.

How more than one option can be selected in drop down?

To select multiple options in a drop-down list, use the multiple properties. It allows you to select more than one option while pressing CTRL key.


1 Answers

You can do this natively with HTML5 <datalist>:

<label>Choose a browser from this list:  <input list="browsers" name="myBrowser" /></label>  <datalist id="browsers">    <option value="Chrome">    <option value="Firefox">    <option value="Internet Explorer">    <option value="Opera">    <option value="Safari">    <option value="Microsoft Edge">  </datalist>
like image 51
onaclov2000 Avatar answered Oct 25 '22 01:10

onaclov2000