Connecting Tech Pros Worldwide Help | Site Map

LARGE Multiple Select requirement

Newbie
 
Join Date: Feb 2007
Posts: 2
#1: Feb 14 '07
I have a cf mx 7 web application that I need to add the ability for the user to select from approximately 400 options. Using a generated list with select boxes on the main form is out of the question because the list is so long. Is there a way to open another cfml file in a different window with a auto generated cfquery result to create this list and upon submission the parent page is updated?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Feb 14 '07

re: LARGE Multiple Select requirement


Quote:

Originally Posted by KenP

I have a cf mx 7 web application that I need to add the ability for the user to select from approximately 400 options. Using a generated list with select boxes on the main form is out of the question because the list is so long. Is there a way to open another cfml file in a different window with a auto generated cfquery result to create this list and upon submission the parent page is updated?

Hello Ken, welcome to the Scripts.

Maybe I've misunderstood, perhaps a bit of background might explain it, but why do you need 400 options? I am sure you can categorise those and use Javascript to only display the ones you need depending on the selections by the user.

Yes, you can interact between windows using javascript. I am unsure what you mean by your query because surely the other page which has the auto-generated list will also be too long.
Newbie
 
Join Date: Feb 2007
Posts: 2
#3: Feb 14 '07

re: LARGE Multiple Select requirement


More info:

I have a listing of training requirements that is categorized into six major levels. Each major is then broken down in sub categories and sub-sub categories.

1 MAJOR TITLE
1.1 title
1.2.1 title
1.2.2 title
1.2.2.1 title


I guess if a major title is selected and give the listing of subs then that would make it more manageable.

I already have this list in a database and can generate the multiple select list with a <cfquery>
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Feb 15 '07

re: LARGE Multiple Select requirement


Have a number of select options (change the size to more than 1 so that you can see more options at once). Until the first one is selected, the rest should be empty/disabled.

Once you make one selection, the next select box should be populated depending on the selection and so on.

Now you have two ways of doing this. One is to load all the data at once and just use Javascript to populate the lists. The second method is more complex using AJAX to connect asynchronously to the server to get the next value.

In terms of Coldfusion, your query code would depend on the tables and how they are structured. For example, are all categories stored in one large table (very unlikely) or all in separate tables (more likely). If you are going to use AJAX, it might be a good idea to use the query of queries feature to speed things up. Also, if your data is not likely to change much/very often, you could consider caching the queries.
Reply