0

I need to display a dropdown with times that the user can select from. Let's say the field currently has "1300" selected. When the user clicks on the select box I want the dropdown to show values like this:

1255

1256

1257

1258

1259

1300 (highlighted)

1301

1302

1303

1304

1305

By default when the user clicks on the dropdown 1300 is highlighted, but if they want to select an earlier time they have to scroll up. I want them to be able to see the selected time and choose an earlier or later time within a few minutes without having to scroll. It's fine if the scrollbar exists in case they need to scroll farther than a few minutes, I just want to prevent them having to scroll up if it was just a few minutes before. Is there any way to do this with plain javascript?

user3897392
  • 397
  • 2
  • 5
  • 22
  • possible duplicate of [HTML Select tag show verticle scroll with 10 option](http://stackoverflow.com/questions/24119643/html-select-tag-show-verticle-scroll-with-10-option) – Dave Aug 31 '15 at 17:54
  • I don't mind having the scrollbar, that seems to be what this link is about. I just want the selected option to appear in the middle of the dropdown so that the user can see earlier times without having to scroll up. – user3897392 Aug 31 '15 at 18:00
  • You should probably show an image or diagram of what your expectations are. – Kevin Peno Aug 31 '15 at 18:26
  • Only with a custom drop-down implementation, as far as I can tell from your description. – Etheryte Aug 31 '15 at 18:33
  • That's what I was afraid of... :) – user3897392 Aug 31 '15 at 20:46

0 Answers0