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 8919463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:01:55+00:00 2026-06-15T06:01:55+00:00

I am creating a form and for what ever reason, when using a bindOnLoad

  • 0

I am creating a form and for what ever reason, when using a bindOnLoad with a remote CFC, my default value doesn’t seem to appear.

Here is the cfselect:

<cfselect name="edcs"
          id="edcs"
          multiple="false"
          bind="cfc:Components.requestSearch.getEDCs()" 
          bindonload="true"
          value="edc_nm"
          display="edc_nm">
    <option name="">Select an EDC</option>
</cfselect>

And here is the function:

<cffunction name="getEDCs" access="remote" returntype="query">
    <cfscript>
        var queryService = new Query();
        queryService.setDatasource("#APPLICATION.db2system#");
        queryService.setName("getEDCs");
        queryService.setUserName("#APPLICATION.db2logon#");
        queryService.setPassword("#APPLICATION.db2pass#");
        queryService.setSQL(
                "select distinct rtrim(edc_nm) as edc_nm 
                   from #APPLICATION.db2owner#.pms_account");

        var result = queryService.execute();
        var edcs = result.getResult();          

        return("#edcs#");       
</cfscript>
</cffunction>

So, when the page loads I see the <option ...> value displayed for a split second and then the list gets populated, and the Select an ECD disappears. I need to have a choice for a null value, which is what the option is for. What am I doing wrong? Thanks.

Addition: According to the CF10 docs, I should be able to use the <option> html tag.
http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7afe.html

  • 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-06-15T06:01:56+00:00Added an answer on June 15, 2026 at 6:01 am

    I’ve run across this issue with CFSELECTs and binding CFCs. I have also been unable to add an <option></option> tag with a bound CFSELECT. The best way would be to create the query and force the result to have the desired input on the top. For example:

    SELECT distinct 
        rtrim(edc_nm) as edc_nm_display,
        rtrim(edc_nm) as edc_nm_value
    FROM #APPLICATION.db2owner#.pms_account
    UNION
    SELECT
    'Select an EDC' as edc_nm_display,
    '0' as edc_nm_value
    FROM dual
    ORDER BY 2
    

    This will return your query with ‘Select an EDC’ on the top.
    Also, as a check, I believe <option name="">Select an EDC</option> should be <option value="">Select an EDC</option>. I hope that helps.

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

Sidebar

Related Questions

I want creating form field hints where the default value shows 'Password' and on
I am creating one form in html using table. Which have one Drop down
I am creating a form using Cake.In the form there is a $this->Form->button($i); element.
When creating form elements with Zend (using Zend Studio for Eclipse), I'd like some
I'm currently confused about creating form using string form name (as in Is there
I'm creating a form using WPF with MVVM. There I have my View with
I am creating a form using wpf/c#. I am looking to programatically change/interpret the
I am creating form using cakephp form. It is creating form something like this:
Why would I ever use save(commit=False) instead of just creating a form object from
Eariler I happily used the following code for creating form elements (inside Zend_Form descendant):

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.