KCK
KCK

Reputation: 2033

Include textbox within option tag in html

I want to include a dropdown in my HTML page where I intend to allow user input also. This question is different from many others on stack overflow asking to add an option altogether.

I have a list of tech indicators in the dropdown. But what I need is when the user selects Simple Moving Average, he/she may also be able to input the desired value for period of SMA. But as far as I have searched, there seems no way to include a textbox within an option tag.

I am ok to use third party plugins like bootstrap/select2. Does anyone have any idea reagarding how this can be achieved?

Upvotes: 0

Views: 171

Answers (1)

yetanothersourav
yetanothersourav

Reputation: 364

Adding of textbox inside native dropdown box is not possible. but you can add another textbox. when certain value selected you can display that textbox to get data. I just found out a fiddle according to your requirements.

Fiddle link

Upvotes: 1

Related Questions