Question

I was wondering if there are any ways to place a Listboxfor inside a Texboxfor? I am using Bootstrap in a MVC project for a registration page and have a text field for character name input and a dropdownlist field for a server select. Currently, they are placed consecutively, but I was thinking it would be visually appealing to have the dropdownlist inside the textbox as they are interrelated.

Thanks for the help!

No correct solution

OTHER TIPS

It's not clear what you're trying to achieve here, but you cannot place a drop down list inside a textbox. That's not how the HTML elements work.

If you just want the drop down list next to the textbox, just put one directly after the other. They're both inline elements (by default, though you may have CSS that changes that behavior), so they'll naturally flow together.

If you're talking about having a combo box, where you start typing and options appear based on entered text, that's JavaScript-based functionality. There's tons of plugins online for that type of thing. Just do a search on Google and integrate one that works best for your needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top