How should I build a privacy drop-down (select) menu?

Posted by animuson on Stack Overflow See other posts from Stack Overflow or by animuson
Published on 2010-04-06T00:57:25Z Indexed on 2010/04/06 1:03 UTC
Read the original article Hit count: 269

Filed under:
|
|
|

I'm trying to build something similar to Facebook's privacy selection menu, except without the 'custom' option. It will only list a few options such as 'show to all', 'show to friends only', or 'completely hidden'. Right now I'm thinking of using simple JavaScript to change a hidden input field to the new value they click on, so if they clicked on the division for 'show to friends only' it would change the corresponding field, say 'email_privacy', to 1. Is there a better way to do this or am I pretty much on track?

P.S. I am not planning on using a select element, I was planning on building a custom drop-down menu using CSS since select elements are so highly non-customizable. I'm doing it this way to save space, rather than having this massive selection menu at the right which takes up a bunch of space.

Note: I'm not really interested in using jQuery, that's just extra libraries and crap that I don't want to load. I can do it in JavaScript just as easily so I might as well use that.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about forms