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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion double combo

Status
Not open for further replies.

GUJUm0deL

Programmer
Jan 16, 2001
3,676
US
I know this can be done in JavaScript alone, but I would like to do the thing in Coldfusion. I would like to do a doule-combo box.

For instance you have 2 select boxes, in select box one you make a choice and the second select box would populate data relating to the option chosen in select box 1.

The JS effect is here:
Any suggestions?


____________________________________
Just Imagine.
 
Cold Fusion doesn't run on the client side. You need the JS to change the form field values.

Look into TwoSelectsRelated on the developers' exchange. It does exactly what you want and generates the JS on the fly.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Eschewing obfuscation diurnally.
 
if you don't want to use ANY JS to do this you'll have to do it in a few steps.

1)user makes selection
2)user clilcks a submit button
3)CF uses the submitted selection to get the list for the second dropdown
4)user selects item from second dropdown after CF creates the addition to the page.

if you can use SOME js you can use the onchange event handler in the first dropdown to submit the form but it still has to make a round trip to the server.

submiting the form is aparent to the user. If you want a seemless action you have to use JS.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Thanks for the replies guys. I guess I should have mentioned how I'm doing this now. Right now I split the page into 3 a page submission; page1 the user selects the program, page2 the user selects the event (based on the program chosen in step 1) and finally in step3 the user fills out all other fields (keep in mind that value selected from the prior step is only displayed on the screen in next step so the user can't change it and cause some logic errors). While this works, and I am having no issues with that, I wanted to know if I can do it via CF.

I know CF is server-side and JS is client-side, and I also know that I would need to refresh the page on each select option chosen for 'program'. My issue came with how I can populate the 'event' fields depending on the 'program' chosen. I would need to use arrays of some kind.


____________________________________
Just Imagine.
 
you don't need to use arrays unless you're trying to use JS, then you need arrays to populate the selects depending on the previous one. and in that case it would be a JS array not CF.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
This proved to be very time-consuming so I am sticking with the 3-page submission. Another problem I realized was that I need to call 2 queries: 1st query for 'program' (so that ALL programs come back) and 2nd query matches what program has an existing event associated with it. I could combine the 2 queries but then if a program has no event associated then that program won't appear in the 1st drop-down.

I will see if I can get it to work on my own, who knows someone elese down the road can appreciate it.


____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top