Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5991501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:23:45+00:00 2026-05-22T23:23:45+00:00

I am editing already existing code, which is why this question is formed as

  • 0

I am editing already existing code, which is why this question is formed as it is. I am attempting to use a query that already exists and without adding more form variables through the url.

So my problem: I have a query that is being run, and this query is being used to populate two drop down lists on the page. One list is the state of operation, and the other is the actual site of operation. At the start of the page, I want the pull down to have only distinct results from the query, currently it is displaying 120+ ‘AL’ 80+ ‘MN’ etc. Additionally I want second pull down to only have results that have the particular state as their state.

I know I can do this by adding more querys, and with a form variable, but I am wondering if there is a way to just filter results in a cfquery.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:23:47+00:00Added an answer on May 22, 2026 at 11:23 pm

    Here’s what I’d do. Only show the state drop down first.

    This would be easier with some example code, but here’s an example. Haven’t tried it at all, but should be an okay start. Never remember how to set selects back to nothing selected…

    First Drop Down

    <cfoutput group= "state">
    <option value= "#state#">#state#</option>
    </cfoutput>
    

    Second Drop Down(s)

    <cfoutput group= "state" style= "display: none;">
    <select id= "#site#" class= "site">
    <option>Select a Site</option>
    <cfoutput>
    <option value= "#site#">#site#</option>
    </cfoutput>
    </select>
    </cfoutput>
    

    Add some JavaScript…

    $( "#state" ).change( function() {
    
    $( ".site" ).each( function() {
    $( this ).selected( '' ).hide();
    
    } );
    
    $( "select[id=" + $( this ).val() + "]" ).show();
    
    
    } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When editing really long code blocks (which should definitely be refactored anyway, but that's
I've editing this original question as I think I've narrowed down the problem... I
For example when editing various data files, the backup data is no use and
I am getting a segmentation fault while running this code. I can't work out
Is it possible to append something to a div that was already appended? I
I have this code: CloudBlob blob = _container.GetBlobReference(relativefilePath); blob.Properties.ContentType = contentType; blob.UploadFromStream(fileContent); When I
Can I, from a modal form, activate an existing nonmodal window? I use Delphi.
First of all, there is no chance that this is a multi-user issue, as
This is my situation: i need the code to run in a loop, over
Google shows that there are already few generic HTML5 canvas-based libraries available. But no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.