Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Related Selects - Cannot get it to work

New Here ,
Feb 16, 2009 Feb 16, 2009
I am creating a report and need to use related selects, second pulldown dependent of first pulldown selection.

I found this example off the internet and it does exactly what I want to do :
http://www.webtricks.com/code/code.cfm?CodeID=18

However, when I attempt to make my substitution in the code, all I get for my second pulldown is the id numbers, no names. I am frustrated beyond belief ! Seems simple enough but I just cannot get it to work and I have been playing with this for over two weeks now.

Can somebody please show me how to do it ? Here is my query (the example uses two but I think it can be done in one)

<cfquery name="GetSites" datasource="dbName">
select distinct
s.siteID,
s.site,
a.siteID as areaID,
a.area as depot
from table1 s, table2 a
where s.siteID = a.siteID
and s.siteID <> 1

My first pulldown will be the site, and depending on what is selected, the second pulldown will be populated with the area (depot) for that site. I tried to substitute my varialbes into the url code and it did not work, Can somebody please show me the proper way to do this ? Thanks
308
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 16, 2009 Feb 16, 2009
What does your code for the second select look like? What is your js code?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 18, 2009 Feb 18, 2009
LATEST
Hi,
I think when you are using JS code then you are assigning the value to the second Drop down box in this way:
"document.formname.second_combo_box_name. text" = some_value
So check "document.formname.second_combo_box_name. text" should be assigned area (depot) name in java script. It should not be number but area name.

I hope this solves your query. Let me know on this.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources