Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

POPULATING A SECONDARY LIST BOX? 1

Status
Not open for further replies.

honky

Technical User
Jan 25, 2001
1
CA
is there an Easy way to populate a second dropdown list box from the results of a first list box without refreshing the screen(similiar to VBA requery command)...would prefer a CF solution and not Javascript
 
I assume you mean that you want the contents of select box 2 to change whenever someone changes select box 1. In this case, Javascript will be your only solution. Since CF is a server side language, CF code only executes when the visitor requests a script. When the script is run, the page is generated and then sent back to the browser. Once the page loads in the browser, CF has no interaction until the visitor submits a form or clicks on a link.

To do what you described with CF will require a page reload and thus a refresh. If you're ok using javascript, you can pre-populate arrays on the server side and pass these back as javascript variables which are used to change the contents of select box 2. For large queries, this can be very resource intensive. In these cases, you're better off with the refresh approach.

Hope this helps,
GJ
 
There is at least 1 custom tag available at allaire.com
I've found at custom tag named 'Activeselect'

Ron
 
Hello,

In the magazine CF ADVISOR ( I read once what could help you out.

It was a combination of WDDX and Javascript. Like GJ wrote you will have to work with javascript.

The example described in the article gave an expample of a drop down box, when you selected one topic it would display information about the selected topic.

So, it was using ColdFusion and the select box was filled dynamically.

If you want I can find the article and send it to you.

With kind regards
bram
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top