Linking select boxes

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Linking select boxes

Post by shiznatix »

Ya I posted on this earlier but now I am doing more of a theory thing.

I want to link: states -> counties -> cities -> city areas

But I want to make it that ALL area loaded originally (save the users who arn't using JS). Is that even reasonable? Thats like close to, min 8 million 'city areas' to be loaded if you don't run JS. Not even mentioning the cities and the rest. Is there another way to do this?

Also, if they have JS running, how should I load all of this? Dynamically is just stupid so I was thinking of doing a static JS page that would be edited if I added more cities or whatever, but even this seams drastic. That file is going to be huge and I would load it every time, sounds aweful.

So either way I hit a brick wall. I want to be able to cover the entire USA with everything but even when I think of western PA it gets extream real fast, let alone the rest of the country.

How can I do this efficiently?

On a side note:
If anyone wants to help write a free php function that will dynamically create linking select boxes I am happy for the help. Right now I want to make this function/class but my JS knowledge is limited but my ideas are not.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

I had to use AJAX to make something like this, it wasn't too difficult. You may want to look into that.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

astions wrote:I had to use AJAX to make something like this, it wasn't too difficult. You may want to look into that.
would that be the only and/or best way to do it? I want an option for non-javascript users (myself) but maybe I am just lagging behind and should stop being racist against javascript.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

The only other option is page reloads.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

AJAX = Asynchronous JavaScript + XML.

There are moves to try and use Java instead of Javascript for AJAX functionality but do not know what the current status is. Personally I don't think if users have javascript off they would allow Java but I may be wrong.

As already stated, unless javascript is used you will need to use page reloads and even that would be a pain as when the first select box changes you couldn't automatically reload the page, the user would have to press a button.
Post Reply