-
Hi,
I know this is the wrong section to be asking this question , but I usually get someone that knows what there talking about here. Lets say I have two HTML select boxes. Depending on the selection on the first one, I would like to populate the second with other information from a database. Can anyone write me a simple script on how to do this.
Thanks
Richard
-
do you want the page to refresh before the 2nd combo box is populated?
-
If at all possible, no. I cannot figure out how to write SUBs in coldfusion so that will probably be impossible. I can make it work with refreshing the page, but the database entries are soooo large I didn't want to reload them every time.
-
how much data will have to be sent to the second combo box? If you need to send 100000 records to your page to account for all possibilities for combo box #1, that is not good.....plus the javascript is a bit complicated to dynamically populate the second combo box
-
What would be really cool is if I could call ColdFusion code inside the Javascript function. Does anyone know how to do that???
-
from what I understand about cold fusion, it is like ASP.
ASP is executed on the server, while Javascript is executed on the client. You can't execute ASP script without a page refresh (well, you sort-of can with remote scripting or maybe even frames....)
-
if you are only pulling out a few records from the db for each selection, you could load each record set into a javascript array.
and then when the selection on the first box is made you could then have a function that changes the select.value of the 2nd box via the arrrays based on the selectedIndex of the first box