I think related selects are the best approach.  I haven't used the custom
tags you mentioned, but I've written my own JS to do the same thing many
times.  Some general things to keep in mind:

- page size: if you have 10 options in box 1 and each one has 10 options in
box 2 and each of those has 10 options in box 3 you are looking at AT LEAST
220 lines of Javascript - and that's IF you do it efficiently!  If you use a
clunky method you could get well over 1,000.  This may execute very quickly,
but it can take the page a while to load...

- JS speed: a good way to do this is to use this syntax (I'm NOT using exact
syntax here...):
        <script...>
        if( box1 = a )
                box2array = new Array(1,2,3,4,5);
        else if( box1 = b )
                box2array = new Array(6,7,8,9,10);

        for( i=0; i<box2Array.length(); i++ )
                create options....
        </script>

        As box2array.length gets into the hundreds (200-300) you'll start
getting noticable freezes in the web page while the second select box
populates.  In general, if there will be more than 200 new options anywhere,
don't use JS

Good luck :)

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: Matthew R. Small [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 16, 2002 12:08 PM
To: CF-Talk
Subject: RE: Running a query in javascript


OK, you're going about this all wrong... you can't execute a query in
javascript.  Your data needs to be processed by the server.

Use the two_selects_related or three_selects_related custom tag.

If these aren't any good for you then I suggest you look into the gif
data pipes. 

http://www.depressedpress.com/DepressedPress/Content/ColdFusion/Essays/G
IFAsPipe/


- Matt Small


-----Original Message-----
From: Bruce, Rodney S HQISEC/SIGNAL
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 16, 2002 2:51 PM
To: CF-Talk
Subject: Running a query in javascript

Hello all

I am trying to run a query inside of a javascript function.
Unless there is another way of doing this.


Without reloading/submitting the form I need to run a query based on
user
selected options
Pass these options to the query and then place the results in a select
box.

Something like:
user is looking for a car,  so the user selects blue, yr 2000, 4x4.
pass options to query, then list all avaible cars in a select box for
the
use to choose from.
Then the form is submitted.

Very easy if form is submited with options ,  the cars are listed on
next
page,  but I would like not to have to submit the form more than once.


Was hoping someone could help me out.
Thanks for any information
Rodney


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to