JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 6th, 2001, 09:33 AM
Ides Ides is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Chicago, IL
Posts: 85 Ides User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via AIM to Ides
Please help with this Javascript

I am having trouble getting this script to reset. This script aloows the user to select a region and in turn, the countries below shift in accordance with the region they choose. The problem occurs when the make a selection and go to a new page... if they try to go back to the script, the region resets but the countries do not! I need to figure out how to get the countries to go back to their default. Can anyone help?

<!--
var regionsArray = new Array(7);
regionsArray[0] = new Array("Botswana","Ethiopa","Kenya","Madagascar","Mali","Morocco","Namibia","South Africa","Tanzania","Uganda","Zambia","Zimbabwe");
regionsArray[1] = new Array("Argentina","Belize","Bolivia","Brazil","Chile","Costa Rica","Galapagos","Panama","Peru");
regionsArray[2] = new Array("Bhutan","Burma","Cambodia","China","India","Ladakh","Laos","Multi-Country","Nepal","Thailand","Tibet","Vietnam");
regionsArray[3] = new Array("Greece","Italy","Turkey");
regionsArray[4] = new Array("Egypt","Iran","Israel","Jordan","Lebanon","Oman","Syria");
regionsArray[5] = new Array("Australia","Hawaii","Indonesia","New Zealand","Samoa");
regionsArray[6] = new Array("Antarctic","Arctic")
function updateCountries(n) {
var arr = regionsArray[n];
var current = document.forms[0].countries.options.length;
for (var j=current;j>0;j--) document.forms[0].countries.options[j] = null;
for (var i=0;i<arr.length;i++) document.forms[0].countries.options[document.forms[0].countries.options.length] = new Option(arr[i],arr[i]);
}
-->

Reply With Quote
  #2  
Old September 6th, 2001, 11:19 AM
szarecor szarecor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: New York
Posts: 122 szarecor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
What's the default state for the countries list?

Reply With Quote
  #3  
Old September 6th, 2001, 02:50 PM
Ides Ides is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Chicago, IL
Posts: 85 Ides User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via AIM to Ides
default

I want region to default to Africa and the countries to default to the corresponding african countries. Currently, the countries remain on the last region selected so if the user selects americas for example, then goes back, the region will be on africa but the countries will be the american countries.

Reply With Quote
  #4  
Old September 6th, 2001, 03:08 PM
gchip gchip is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 1 gchip User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
how about putting

onLoad("updateCountries(0);")

in the body tag?

Last edited by gchip : September 6th, 2001 at 03:29 PM.

Reply With Quote
  #5  
Old November 2nd, 2001, 02:03 PM
Ides Ides is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: Chicago, IL
Posts: 85 Ides User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via AIM to Ides
Thumbs down

That didn't help. Any more clues?

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Please help with this Javascript

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap