November 25, 2003

Getting the face just right

I just wrapped up a project at work. We had to whip out a web application to accept customer business plans. The last part was some client side javascript to validate user input before submitting it. Most of the fields on the form expect numbers, dollar amounts, or percents. I wanted to validate each number after it was typed to makes sure it had the right number of decimal places and had no extra characters ($,%,etc). Because this was a luxury (the form processing would clear out any bad values as well) i decided to target only browsers that support at least support .getElementById() (gEBI browers). With that in mind, how hard can it be to dynamically set the "onblur" event after the page loads? It turns out events are something that still have crazy difference among applications. I was going nuts till a found a tutorial on the DOM event model. I spent a lot of time working on that little feature. Why? That's hard to explain.

You remember that guy in Amile who painted that painting over and over again because he couldn't get the look of the girl in the middle just right. He could draw eyes, a mouth and a nose and when you put it all together you get a face but it just somehow wasn't right; it wasn't great. Sometime i feel like an artist at my keyboard. I try things out on my pallet and i go over parts of the code over and over again to make them better; to make them more beautiful. However, it seems like there is always more work to do.

My code will never appear in a gallery; in fact few other people will ever see it or even care how i do something. Perhaps I think my code is my legacy or that it somehow reflects how i am. That’s sad isn’t it. I need a new hobby.

Posted by Matthew at November 25, 2003 07:54 PM
Comments