|
-
Jun 17th, 2000, 06:41 AM
#1
Thread Starter
Member
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
-
Jun 18th, 2000, 02:49 AM
#2
Guru
do you want the page to refresh before the 2nd combo box is populated?
-
Jun 18th, 2000, 02:57 AM
#3
Thread Starter
Member
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.
-
Jun 18th, 2000, 03:00 AM
#4
Guru
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
-
Jun 18th, 2000, 03:28 AM
#5
Thread Starter
Member
What would be really cool is if I could call ColdFusion code inside the Javascript function. Does anyone know how to do that???
-
Jun 18th, 2000, 03:34 AM
#6
Guru
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....)
-
Jun 19th, 2000, 10:49 PM
#7
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|