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

Populating Related Select Fields

Guest
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

I work for a university and I am working on making some reports in Coldfusion. One report is to see who was participating in an extracirricular activity during a certain semester. I would like to have it so my first drop down is populated by querying all the activities in the database and then once the activity is chosen the 2nd drop down will be populated by querying all the semesters that activity took place (i.e. football doesnt take place during the spring or summer semesters so my user doesnt need to be allowed to choose those semesters). Is there a way to populate the second field based on the first field without hardcoding this in JS or without using AJAX?
TOPICS
Advanced techniques

Views

337

Translate

Translate

Report

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 ,
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

If you want to do it without js or ajax, you have to submit the form.

Votes

Translate

Translate

Report

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
Guest
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

Okay, well how can I do it WITH Ajax then 🙂

Votes

Translate

Translate

Report

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 ,
Oct 18, 2006 Oct 18, 2006

Copy link to clipboard

Copied

Take a look at ajaxCFC from Rob Gonda.
http://www.robgonda.com/blog/projects/ajaxcfc/

--
Bryan Ashcraft (remove brain to reply)
Web Application Developer
Wright Medical Technology, Inc.
------------------------------------------------------------------
Macromedia Certified Dreamweaver Developer
Adobe Community Expert (DW) :: http://www.adobe.com/communities/experts/


"BattleManJ" <webforumsuser@macromedia.com> wrote in message
news:eh2qi5$ffb$1@forums.macromedia.com...
> Okay, well how can I do it WITH Ajax then 🙂


Votes

Translate

Translate

Report

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
Explorer ,
Oct 30, 2006 Oct 30, 2006

Copy link to clipboard

Copied

LATEST
In a nutshell (if you want to avoid Ajax) you need: -

An IFRAME with an ID of iframeID, (with display:none css setting - but leave it visible while developing)

Then, with the first <select>, onChange="document.getElementsById('iframeID').src='getData.cfm?selected='+this.id);"

in getData.cfm you can then reference the second select box to delete all it's options (selectBoxRef.options[0]=null until it's empty.

Then repopulate if from it's query...

Votes

Translate

Translate

Report

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
Documentation