jQuery fails me?

Well, I haven’t posted the last three days.  Of course on our schedule and thanks to Thanksgiving, it’s been over a week.  It’s been tough getting the focus to write a blog post, with the fact that I’ve been putting quite a bit of time in over the weekends and still feeling like I’ve got too much that I have to keep track of, finding some good random topic to discuss every day weighs on me, as I’m sure it does everyone in the office.  The 15 minutes we are supposed to be spending on writing turns into an hour and then it’s a completely unproductive situation which then just compounds the situation.

What’s been bothering me this week has been a jQuery problem.  I don’t know so much if its jQuery or Javascript, or the fact that I have multiple forms on each page each having identical IDs which is against wc3 proper HTML code.  The problem is that I struggle with having to write efficient Coldfusion code or having my pages fit some standard.  But that’s all another story for another time.  The issue I’ve run into is the fact that I want to have unobtrusive Javascript (meaning I don’t have to hand code each one and it degrades gracefully should someone not have Javascript turned on) to help out with what’s called a dependent drop down.  This means that there are two drop downs (selects) on the form, one which would traditionally determine what the other should be.  So for example, a list of countries which, when selected, populates the other dropdown list of states/provinces for that country.  It’s usually pretty simple to do, only in the cases I’m working with, there will be multiple forms on the page.  Normally jQuery or even Javascript would allow you to select the distinct field that was related, such as myForm=mySelectedField.form then myForm.myDependantfieldID.  The problem is, jQuery doesn’t like it for some reason.  So, though I can’t take work time to figure it out, it’s been weighing on my mind, so I will have to figure it out or I will continue to lose sleep.