By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

How to refresh an ASP list/menu following selection from a preceding list/menu

P: 87
Greetings,

I am using Dreamweaver CS3 to design an ASP page that contains an Insert Record Form. Within this form are two list/menu form fields that I would like to "synchronize". In other words, let's say one list/menu is where the user selects "Program Name" and a second is for selecting "Project Name". If the user makes a selection from the first list/menu, then the second list/menu is requeried and "refreshed" to show only the project names for the selected program name.

I understand the problem with ASP being a server-side technology and that it ceases to work as soon as the page is loaded. I need some client-side scripting to make this work and I want to know how to do this with javascript because my efforts to refresh my page each time and send the parameters through a querystring haven't been very successful.

I can post code for what I have thus far should anyone want to see it, but thought I'd pose the question first to see if anyone has any advice or URL links/examples to point me toward.

Any advice or suggestions would be most welcome.

- JM
Jul 2 '08 #1
Share this Question
Share on Google+
5 Replies


acoder
Expert Mod 15k+
P: 16,027
You have two choices. Either load all the options (in arrays) during page load and use them onchange, or whenever a change occurs, make an Ajax request to get the options for that particular project. Which one would you prefer or is more appropriate in your case?
Jul 3 '08 #2

P: 87
The first one (loading options in arrays) is probably more appropriate given my limited java knowledge.
Jul 3 '08 #3

acoder
Expert Mod 15k+
P: 16,027
You should find this link useful.

Note that it's JavaScript, not Java.
Jul 3 '08 #4

P: 87
Thanks for the link. Do you also have a link for the Ajax request option? I ask because if I run into issues with the JavaScript, it would be nice to have a backup plan.
Jul 3 '08 #5

acoder
Expert Mod 15k+
P: 16,027
Here's a quick general Ajax example. What you would do is change the ASP to return the options of the list. You can either return the HTML and just set a select object's innerHTML to the response or return a delimited which you can split to get the options.
Jul 3 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.