Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 5th, 2003, 10:41 AM
Authorized User
 
Join Date: Jun 2003
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic Menu - Using multiple dropdown boxes

Hi,

I was wondering whether someone could help me with the following :

At works I saw an application using JavaScript to create dynamic menus. Based on the selection in the first <SELECT> box, the second <SELECT> box was created with associated values. Everytime that it got new information, there was a request back to the server without [that is what it seemed to do] refreshing the page. So, the page was left with the old contents and <SELECT> boxes were added with fresh data. I checked the JavaScript code and it seemed pretty advanced. However the technique used is quiute simple. The old page stays the same, but the <SELECT> boxes get updated by requesting new info. If you make a choice in the first box, you can clearly see the progress bar in the IE window at the bottom.

So what I would like to do is :

[All data is held in an MS ACCESS or SQL 2000 Database]

- create a form on a page with in the first select box the country name [eg. Belgium, UK, France, ... located in the coutnry table of the DB]
- the second box is not displayed as long as nothing is selected in the first box. It will hold the cities of that particular country [eg. Brussels, London, Paris, ... located in the cities table of the DB]

The difficult part : THE PAGE MAY NOT SEEM TO RELOAD AT ALL.

The database access would go through ASP.

I already tried making something similar by putting all data in an array, putting the array in different SELECT boxes and to hide/show them using Cascading Style Sheets. However, there is still no limit in tranfsfer to the server, and it will take all data from the database and load it in memory.

Can someone please help me out ? Does this all make sense ?

If so, you can still come over to Belgium, I'll buy you a fresh, nice beer !

Sebastiaan.
 
Old November 29th, 2003, 04:41 PM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ecmonzon Send a message via Yahoo to ecmonzon
Default

This question should be in ASP Databese Forum, you must learn ASP and Database to achieve this kind of knowledge.
Don't give up.

ecmonzon.:-)
 
Old December 1st, 2003, 05:36 AM
Authorized User
 
Join Date: Jun 2003
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i did this by using two forms. then u should use the "onchange-event" to post the first form. Then u could use some hiddenvalues to store the values from the first form into the second one. WEll i realize this is a short answer, if u are still interested in this solution then let me know :)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Menus - Using multiple dropdown boxes Sebastiaan ASP.NET 1.0 and 1.1 Basics 1 April 18th, 2007 06:25 AM
Javascript Dynamic dropdown Menu itHighway Javascript How-To 0 July 24th, 2005 10:53 PM
dynamic dropdown boxes fmh002 Classic ASP Basics 1 June 26th, 2003 08:35 PM
Dynamic Menu - Using multiple dropdown boxes Sebastiaan Classic ASP Basics 3 June 7th, 2003 06:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.