7
I have a list of Brazilian states created with the command select/option
HTML5,
When I click to choose the state, 20 lines(states) appear and overtake my text box down.
I want to restrict the number of lines/states that appear after clicking to choose.
I don’t want to use the size="x"
and yes I want 10 lines to appear when I click the button to
choose the state.
It’s a good question, but I don’t think you can control it. The only way would be not to use
<select>
, and yes some substitute made with HTML + CSS + Javascript.– bfavaretto
It’s been a while without updating, but it’s quite unobtrusive ms-Dropdown, {demo}, note that if you start typing the dropdown does the search, a bit like the top left menu here of the site.
– brasofilo
10 lines means you want to display only the first 10 states? If so, what if the user is from a state that is not being displayed? You have the screen image or more details to add in the question?
– Renan
You can control this at the time of listing, if you are doing this for a JS, if it doesn’t get complicated, you would have to use some of the tips acimas.
– Marcelo Formentão
You want the top 10 in the box and the rest is in the scroll bar? if it’s not that then you just put only the 10 option’s even
– SneepS NinjA