View Full Version : Customizing dynamic select boxes

12-10-2009, 01:47 PM
Hi all,
I'm trying to customize a script I found. It's about two select boxes, one for continent selection and one for country selection. When user selects a continent from the first select box, the second select box is filled with the list of the proper countries that belong to this continent.

You can see that code of the script here: http://www.howtocreate.co.uk/jslibs/htmlhigh/countryselect.html (http://www.howtocreate.co.uk/jslibs/htmlhigh/countryselect.html)

In my page, the continent select box is loaded with a continent-value already selected (the selection depends on a database value) and I want to have the second countries select box, also loaded with the proper countries.

I cannot make this happen, unless I change the continent's selection and trigger the onchange event. Can I someway keep the onchange event and also add the ability to have a continent and it's list of countries already loaded?

12-10-2009, 04:22 PM
can't you trigger that function onload? I see that the genuine code does that. What is going wrong? Can we have a link to a test page?