Wheels is only a hammer

Thursday, October 8th, 2009

My posting this is a seriously delayed reaction. But I must admit that I was using Wheels as a hammer and trying to treat a problem like a nail when I wrote about creating a Wheels partial for setting form focus.

Stephen came up with a much nicer jQuery-only solution for setting form focus:

$(document).ready(function(){
    $(”.focus).focus();
});

So now you can set form focus on load by setting that element’s class to focus. No need to create a Wheels partial and set a variable in your CFML.

In my newbness, I wasn’t thinking that you could have that $(".focus") hanging there without it applying to something on every page. Now I am schooled.

Thanks Stephen!

Technorati Tags: , , , , , ,

3 Responses to “Wheels is only a hammer”

  1. Grant Copley Says:

    I find myself getting schooled lately too. It happens to the best of us. :)

  2. Stephen Says:

    Tit-for-tat, Chris.  I am just getting into Wheels, and am getting schooled regularly myself.  Cheers! :)

  3. Chris Peters Says:

    Thanks for getting my back, guys. At least we’re all in similar company!

Leave a Reply