Intelligent Select Box Filtering

One of the great things about building websites for a living is the challenges tend to change from day to day. There’s always a new puzzle to solve.

Take today, for example. I was building a page that contained a series of select (dropdown) boxes. Now, I’ve been around the block once or twice before, and this wasn’t my first time using selects. However, this implementation came with a unique twist: all the boxes contained the exact same options, but we only wanted each to be selectable once. Specifically, each box contained a list of security questions — your mom’s best friend’s grandmother’s maiden name, that sort of thing.

The code looks something like this:

<select class="security" name="security1">
	<option value="0">Select a question.</option>
	<option value="1">Who's your daddy?</option>
	<option value="2">What's your favorite color?</option>
	<option value="3">What time is it?</option>
</select>
<select class="security" name="security2">
	<option value="0">Select a question.</option>
	<option value="1">Who's your daddy?</option>
	<option value="2">What's your favorite color?</option>
	<option value="3">What time is it?</option>
</select>

Now, naturally, we want the user to select several different security questions. But what’s to stop them from selecting the same question several times? Well, in our case, back-end validation… but I wanted to solve the problem before we got to that point. I wanted to eliminate “selected” questions from all the other dropdown boxes, so it wouldn’t even be an option. This has the added benefit of shortening the list of options as the user goes along, which would make scanning the options easier. Read the rest…

Cross-Browser Rounded Buttons with CSS3 and jQuery

I was tasked with replacing several dozen Photoshop-generated rounded buttons on a large site with a flexible HTML/CSS/JS equivalent. I wanted it to be simple and leave the code as clean as possible. It also needed to work in all modern browsers. This is my solution.

Test for Border-Radius Support

Rounded corners with border-radius are nice… when they work. Unfortunately, not all browsers support border-radius yet. Here’s a simple script that will let you test for border-radius support using jQuery.

I’m Attending AEA Seattle!

Once I’m done stuffing myself with Easter-related goodies this Sunday, I’ll be catching a plane to Seattle to attend the An Event Apart conference. An Event Apart is two days of presentations on web design and the evolution and mastery thereof.

Show Your Google Analytics Top Content in Wordpress

If you’re a typical blog owner, one of your biggest goals is to keep visitors browsing your site. One good way to do that is by showing off your most popular posts. Here’s a way to show your Top Content from Google Analytics on your WordPress blog by piggybacking on an existing plugin.

Understanding the CSS Float Property

Floated elements are a different beast than anything else in CSS. And many people don’t know how they work and interact with your document. Let’s remedy that.

Button Height and a Broken Box Model

Buttons don’t behave like normal elements when it comes to the standard CSS Box Model. In fact, they seem to ignore the box model altogether in favor of an IE6-style model. Strangely, this seems to be true across all modern browsers!