Hi
Write out the data as client side arrays
The add option thing should go something like this:
function addOption( theForm, theName, theID ){
var myOption = new Option();
myOption.text = theName;
myOption.value = theID;
theForm.theSelect.options[ theForm.theSelect.options.length ] = myOption;
Quote:
}
Reset / Clear the select
theForm.theSelect.options.length = 0;
--
Best Regards
Vidar Petursson
==============================
Microsoft Internet, Client, SDK MVP
==============================
http://www.icysoft.com
http://www.dna.is
==============================
No matter where you go there you are
--
Quote:
> Hello,
> Does anyone have any good sources for dynamic select boxes? I.e. I am
using
> VBScript ASP to extract lookup data from SQL Server into various select
> objects. However, there is a primary-foreign key between two of them which
> means that the options in the second select object must change according
to
> what the user selects in the first select object.
> Currently, I have an onChange event on the first combo which submits the
ASP
> back to itself, repopulating the second combo with the options relating to
> the option the user has chosen for the first combo. This is very
cumbersome.
> I'm basically looking for some way of getting VBScript to fetch all the
> different collections of options for the second select object and make
them
> available client-side. Then, when the user changes the value of the first
> select object, the second's options are automatically synchronised.
> I have seen some examples of this on the CoolNerds site but it looks very
> difficult. Also, I understand that dynamically adding options to select
> objects works very differently in IE than in Netscape.
> Any assistance gratefully received.
> Best regards,
> Mark Rae