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

  • Home
  • SEARCH
  • 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 3226356
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:26:46+00:00 2026-05-17T16:26:46+00:00

I have two cfselect boxes that use binds and a cfc. One is State.

  • 0

I have two cfselect boxes that use binds and a cfc. One is State. Choose a State, and the second cfselect (counties) is populated on the fly.

Prior to doing this with the bind attribute, I relied on the queryPostion=”below” attribute such as the following to basically put a blank row into the option box. I want to do the same thing for both the State and County select boxes now, as I’d like to have “” values (or an “ALL” value as an option in each. But queryPostion no longer works.
I’m not sure of a work-around.

//original... leaves a blank option:
     <cfselect enabled="No" name="search_state" multiple="no" query="get_States" value="StateUSAbb" display="StateName" queryPosition="below">
                      <option></option>
    </cfselect>

  //now, w/bind, doesn't work:


    <cfselect bind="cfc:states.getStates()" bindonload="true" name="search_state" 
                  value="StateUSAbb" display="StateName">    
    </cfselect>

    <cfselect bind="cfc:states.getCounties({search_state})" bindonload="true" name="search_county" value="FIPS_County" display="CountyName" >
    </cfselect>

UPDATE
Solution for both queries:

     SELECT DISTINCT tblLoc.StateUSAbb, lkuState.StateName
        FROM lkuState INNER JOIN tblLoc ON lkuState.FIPS_State = tblLoc.FIPS_State
        WHERE (lkuState.StateName <> 'New Brunswick')
        UNION
        SELECT '' AS StateUSAbb, '' AS StateName
        FROM lkuState
        ORDER BY StateName

SELECT '' AS FIPS_COUNTY, '' as CountyName
        FROM lkuCnty
        UNION
        SELECT FIPS_County, CountyName
        FROM lkuCnty
        WHERE StateAbb = '#ARGUMENTS.stateabb#'
        ORDER BY CountyName
  • 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-17T16:26:47+00:00Added an answer on May 17, 2026 at 4:26 pm

    UPDATE: Never mind. Looks like the same was already suggested while I was replying 😉

    AFAIK, there is no built in option for creating empty elements in bound select list. At least not with CF8.

    Since binding will replace the list contents, you would need to add the empty options to your query results. One technique is to add the empty option to your query results via a UNION.

    Depending on the list values, either

    SELECT 0 AS SortOrder, '' AS StateUSAbb, '--- ALL ---' AS StateName
    UNION ALL
    SELECT 1, StateUSAbb, StateName 
    FROM   YourTable
    WHERE  (some condition ...)
    ORDER BY SortOrder ASC
    

    … OR possibly

    SELECT '' AS StateUSAbb, '--- ALL ---' AS StateName
    UNION ALL
    SELECT StateUSAbb, StateName 
    FROM   YourTable
    WHERE  (some condition ...)
    ORDER BY StateUSAbb
    

    UPDATE
    As a point of interest, the difference between using UNION and UNION ALL is that UNION removes duplicates. UNION ALL does not. Since a UNION query is slightly more expensive, I only use it when needed.


    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.