change drop down box values on the fly

M

Matt

I have 2 drop down boxes. When the user changes the values in one drop
down box,
the values in another drop down box will be changed on the fly.

Is it possible to do that? in client side or server side? what's the
best approach to
this problem?

please help. thanks!!
 
M

Mitja

I have 2 drop down boxes. When the user changes the values in one drop
down box,
the values in another drop down box will be changed on the fly.
Is it possible to do that? in client side or server side?
"on the fly" by itself implies client side, i.e. JavaScript.
what's the
best approach to this problem?
server side processing, i.e. your favorite scripting language. Otherwise,
the site won't work for people with JS disabled or unavailable.
 
M

Michael Winter

I have 2 drop down boxes. When the user changes the values in one drop
down box, the values in another drop down box will be changed on the fly.

Is it possible to do that? in client side or server side? what's the
best approach to this problem?

Yes, it is possible to do it both client-side and server-side. The best
approach is to actually use both: attempt to do it on the client first and
if that fails, fall back to the server. It's a little more work for you,
but it provides both a quick and robust interface. If the script is kept
in an external file (and it should), it should also reduce the total
traffic as unscriptable user agents won't download unnecessary data.

A generic client-side solution would be too bloated, so if you want a
demonstration, it would be best to provide more information, preferably
showing the page that will contain this feature.

If you don't have the necessary server-side support (so only a client-side
solution is possible), Richard Cornford provides a possible answer:
<URL:http://www.litotes.demon.co.uk/example_scripts/dependent_select.html>.

Mike
 
A

Andrew Thompson

...The best
approach is to actually use both: attempt to do it on the client first and
if that fails, fall back to the server.

What's the point of that? If you have server-side includes I cannot
see the sense of attempting it client-side.

F'Ups not set, but please consider doing so in future cross-posts.
 
M

Michael Winter

What's the point of that? If you have server-side includes I cannot see
the sense of attempting it client-side.

It's quicker for the user, basically. It also has the potential to reduce
the number of requests made to the server.

Based on your argument, why bother validating forms on the client when you
can just wait for the server to throw back a message saying the user made
a mistake?
F'Ups not set, but please consider doing so in future cross-posts.

The post is valid in both groups, particularly as the discussion goes
beyond just Javascript.

Mike
 
A

Andrew Thompson

....

The post is valid in both groups, particularly as the discussion goes
beyond just Javascript.

(Head of legal team) What Mr. Thompson *meant* to say there was
'Please set follow-ups once the most appropriate group becomes
clear, assuming the there *is* a most appropriate group. Thank you
for attending, that concludes the press conference. No autographs
will be signed at this time.'

(General hub-bub as legal team hussles Mr. Thompson from press conference)
 
M

Matt

thank you so much for the suggestions.

If i do in client-side, then I use JavaScript event and <div> tag?

If i do in server-side, then I will post the same page to server?

please advise more. thanks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top