Monday, June 16, 2008

Get (rid of) Smart

I recently spent days, possibly even weeks - I've blocked most of it out - fighting a particular problem on a .NET project. I am working on a web form, and I need the focus to be in a particular textbox immediately upon display. On one form, the textbox displayed immediately; on the other, it displays after a selection is made to a radio button group. I also need the focus to move to the next textbox on tab for manual entry.

No matter how I coded the textboxes, no matter how I referenced them in javascript, no matter what I hard-coded in the HTML, I could not get the focus where I needed it, when I needed it. Google did not help. Safari did not help. My coworkers looked at it for over an hour one day - no help.

After days of trying everything I could think of, and a bunch of things I just made up, I finally got it to work, and performed a victory dance the likes of which has not been seen since the '85 Bears.

Note to self: If you want to control focus on your webform - TURN OFF Smart Navigation on that webpage!

1 comment:

PedroG said...

I love those sorts of bugs. But given the amount of pain it caused you, I'm betting you never forget that one :)

Fortunately, I've been able to stay away from webforms. If I do run into problems, however, I now know who to call for help :)