Friday, April 15, 2005

Learning Javascript

I am quickly learning that I have been spoiled working with Notes. The notes objects make dealing with data soooooo easy and it takes little to no thought to move things around, set fields, check data in fields.

Tonight I start my Javascript course. It's a weekend course, but this week I've been pre-learning a lot of stuff through the project I've been working on. I am now very familiar with the if statement and the alert statement... oh and those fun little curly braces {}

And this morning, I wrote my first for loop. Sooo much like C++, I felt like I was home again. You know, that slightly uncomfortable feeling you get when you used to live somewhere, but now you take your shoes off at the door and hang your towel up after a shower instead of leaving it on the floor. It's home, but you're not ready to start digging around and making a mess.

The first thing I learned this morning was that radio buttons and check boxes in Javascript are not nearly as easy to access as they are in Notes. In Notes, I do a wonderful little field(0) reference and voila, I know what the radio button is set to. For a checkbox, that gives me the first selection if more than one item is selected (arrays, gotta love 'em).

In Javascript however, field[0] only tells you if the first value is selected or not. Therefore, for my little radio button to be validated as a required field, I have to loop through the options in the field to see if any are checked.... field[0].checked. Which is cool, but annoying when one is used to more simple field referencing.


Post a Comment

Subscribe to Post Comments [Atom]

<< Home