Sneaky Abstractions

Subscribe to my Feed, follow me on , recommend me on Working With Rails or see my code on GitHub

FormHelper

Posted on September 28, 2007 23:28 Tagged with javascript.

An unobtrusive "unobtrusive" answer to the very frequently asked question “how do I create a dropdown that fills out another dropdown”.

<select name="foo" class="updates:bar">
  <option value="1">1</option>
  <option value="2">2</option>
</select>
<select name="bar">
  <optgroup label="1" class="foo:1">
    <option value="1">1.1</option>
    <option value="2">1.2</option>
  </optgroup>
  <optgroup label="2" class="foo:2">
    <option value="3">2.1</option>
    <option value="4">2.2</option>
  </optgroup>
</select>

And it just works.

Download now for the low price of nothing and get one extra feature for no added cost! But wait, there’s more! Download within the next ten years and receive the practical Checker for free!

I’m Sheriff John Bunnell, most people don’t even think about law enforcement until they either do something wrong, or get wronged them self. But police know that fighting crime is a full time job. If something isn’t going down now, it will be soon and officers have to be ready. So get ready, what we’re going to show you tonight is the ruthlessness of criminals, the toughness of cops and the clash if both sides refuse to back down.