0

I mean, I'd like to use a <select> list of options, and change document.location with javascript based on the selected option. I'd use it for product categories navigation. I already use it that way for ordering produts based on price and title.

Since it's a form element, is there anything 'wrong' doing it like this? Should I only use anchor tags maybe in lists for navigation? Or is it acceptable even to use select inputs?

1 Answer 1

1

I don't know if there is anything Wrong with it; I've seen it used in some pretty big sites, but there are some things to consider.

  • If the user agent has javascript disabled for some reason (it happens), the site is unusable unless you implement progressive enhancement.
  • In my experience, it takes less time and effort to get a <menu> element looking good. Whenever I try to style a <select> element to get just-the-right-look®, I usually spend way too much time banging my head against the wall, then I inevitably use the css rule appearance:none and pretty much start from scratch.
  • If you have alot of categories, you might consider a text input with a datalist. Here is an item on Stack Overflow about it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.