Nov 06

This week at work I've been struggling with a relatively simple problem that is disturbingly difficult to solve (at least as a humble web developer like myself).

Basically, I need to generate a dynamic, database-driven, menu system that will allow me to make some highly complex (tree-like) decisions based on user decisions.  Ok, stated out like that, it may seem to be a complex problem.. but it's not, I promise.

In more simple terms, I need a drop-down menu system that will allow a user to “drill-down” to the proper final output without having to click on twelve submit buttons and having a lot of constraints on what they can pick depending on what was chosen in the last drop-down.   I'm attempting to mix some, AJAX, and a Pear tree (a PHP plugin which was last updated on 3/17/03 as a beta). 

Let me give a real world example of what I'm trying to do.  You can imagine my problem by thinking about how you would implement a car repair web site.  If you wanted information about your 2002 Ford Mustang's automatic transmission: you would first pick “2002″, which would then fade in a new drop-down with all the valid 2002 car models… so then you pick “Ford”… which would then fade in another new drop-down with all of the valid 2002 Ford models… now you pick Mustang… we get a new drop-down with the different 2002 Ford Mustang models… I think you get the idea.

The real problem is in doing this efficiently, elegantly, and enhancing the experience with a touch of Scriptaculous.  It's tougher than you might guess.  I'll let you know how it ends up!

A special note to Jim: Yes, I know this problem might be easier solved in Rails, but who says a challenge isn't fun?

4 Responses to “This Weeks "Struggle"”

  1. Anonymous Says:

    this post is boring. truth hurts.

  2. Anonymous Says:

    Jim, I know that's you! You just think it's boring b/c you didn't write it. I'm gonna start writing negative comments like this on your blog. At least I won't delete them… I know you will.
    - Dustin

  3. Anonymous Says:

    You know I don't post anonymously, I'm a MAN. Yeah, it might be easier in Rails… if you already knew Ruby.

  4. Anonymous Says:

    A MAN huh? ::giggles::
    Yeah, I'm slowly reading up on it and when I get the server back from you, I'll be using it as a dedicated linux box for ::gasps:: ruby on rails learning.
    It'll be fun and you can help me when I get stuck. Right?
    Jim… ??
    - Dustin

Leave a Reply