Dynamic select objects 
Author Message
 Dynamic select objects

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



Sun, 23 Mar 2003 03:00:00 GMT  
 Dynamic select objects

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



Sun, 23 Mar 2003 03:00:00 GMT  
 Dynamic select objects


Quote:
> 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;
> }

> Reset / Clear the select
> theForm.theSelect.options.length = 0;

Thanks very much - does this work in Netscape too?

Mark



Mon, 24 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. dynamic select list

2. How do you create Dynamic SELECT boxes?

3. Dynamic Select

4. SELECT / Dynamic OPTIONS Netscape Sizing Issue

5. Dynamic SELECT listbox - BACK button

6. Dynamic SELECT box in HTML

7. How to build a dynamic SELECT statement?

8. VBScript Dynamic Select Case

9. Dynamic Select box filling

10. Dynamic Select list..How?

11. Dynamic Javascript Menu's and Select Boxes

12. dynamic select box problem

 

 
Powered by phpBB® Forum Software