Archive for September, 2006

Dynamic Select Boxes

I need to have two select boxes. One with a major category, and once selected another one appears with sub categories.

For sake of example, say I have 8 major categories.

At first, I thought I’d just make 8 selects with the sub categories, and just hide/show the ones I didn’t need or need. Fine .. but the form still sees them when you submit! so my subcategory name was getting overwritten by the hidden selects. No good.

I load my data into a javascript array, so I do the dyamic thing where I loop through the array and add options to the DOM. Fine .. works.

something like:

for (s in data) {
label = "       "+data[s][1];
$(’sub_cat_select’).options[i] = new Option(label, data[s][0]);
i++;
}

But — my subcategoris are actually “tree like” and there are sub categories. With my hidden selects, in php I added & nbsp ; to create an “indent” which showed up fine. However, usin the dom, my & nbsp didn’t work.. and neither did putting a real space.

I just find it weird that if I used php to print my option lists with the & nbsp … it worked.. but then putting the & nbsp when doing the dom way it didn’t work. Any suggestions on how to indent? next I am trying style sheets, but I think that will be a bit of a pain.

Comments (2)

Windy City has Google

The Chicago Google office volunteered to host and feed the Python meeting this month. Everybody I say this to, says “I didn’t know that Google had a Chicago office!?!” as if Google should make a full page annoucment when they open an office somewhere. I admit, I went partly to see what it was like and Python is on my radar of languages to learn next.

Brian Ray talked about operator overloading in Python, which is always cool to overload something. Then the Google guys gave an overview of Google Code and touched on things like Big Tables (of which I knew nothing). Then my buddy Jason Huggins (Selenium guy) talked about Selenium and showed off his freaking cool MAC laptop and virtual machines. I have got to see if I can do that on mine.

I had to leave early to catch the 9:20 train.. but such is life.

Comments

Employed - 2 weeks!

I accepted a job at www.info.com …. a pretty nifty search engine company in downtown chicago. Its quite interesting work!

I finally WROTE again.
. for a contest over at CodeSnipers. Vote if you want


I have some plans to write some more after my past three months of hermit mode. I guess, I was just soooooooo busy hitting the perl that I didn’t keep up with much anything. I even missed the July Issue of Linux Journal, with sexy ruby man (not my words, a friend calls him that!) DHH .. Maybe I can find someone to loan me a copy.

Comments (1)