It's more than a house. It's an adventure.

Thursday, September 25, 2003

More DHTML pain

Today's struggle? attachEvent(). In the process of creating my form elements dynamically, I need to attach some events to them for validation, etc. I had this working in the "standalone" elements, the ones that were already existing, but as one-liners (code embedded right in the onblur attribute, rather than calling a function). But you can't do that in attachEvent() (and its sibling, addEventListener()), you can only use functions.

I feel like I've been out of the game so long because of how I'm struggling with some of these seemingly basic things. The good news is, I wrote a ton of JavaScript today to create all my dynamic select boxes, then ripped it all out 45 minutes before leaving for the day, refactored it, and cut the LOC my about 75% - and left myself with a lot more reusable code in the process.

I gotta say today was a good day

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home