Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default cfselect values

    :confused; Im trying to populate a drop down select menu with the first and
    last name of a customer in the form of (last_name, first_name) but the first
    and last name are too different columns of the database and all i can figure
    out is only firstname , or only last name.

    TheEngineer Guest

  2. Similar Questions and Discussions

    1. Can we bind the values from cfselect to display thoseinto cfinput text boxes.
      Hi, I have a cfselect box which is having values from cfquery. I want to bind those values into few input boxes. I have been trying for so many...
    2. CFSELECT Help!!
      I have a flash form page that when an item is selected in a <cfselect> field needs to populate five other fields on the form. Please help me!!!
    3. CFSELECT HELP!
      What I am trying to do seems simple but I'm going crazy! I need have a page where I have the user "Select Options" from a drop down box and when...
    4. cfselect options dependent on choice from other cfselect
      I have 2 cfselects. 1st is category, 2nd is sub category. both are populated from database queries, but the options from the sub cat vary based...
    5. CF7 BIND CFSELECT to populate a 2nd & 3rd CFSELECT
      Please could some show code of how this is done: CF7 - Flash page Question: How do I bind these cfselect dropdown lists to one another as per the...
  3. #2

    Default Re: cfselect values

    <option value="#last_name#, #first_name#">#last_name#, #first_name#</option>
    eastinq Guest

  4. #3

    Default Re: cfselect values

    im trying to do it as a cold fusion form and that doesn't work, heres the code
    that i have

    <cfselect name="tenant" query="tenants" value="last_name">
    <option value="#last_name#, #first_name#">#last_name#,
    #first_name#</option>
    </cfselect>


    Thanks for the help, if you havent noticied Im a super newbe.

    TheEngineer Guest

  5. #4

    Default Re: cfselect values

    Hi TheEngineer

    I haven't really used CFSELECT before but the attached code works

    It looks like wtih CFSELECT you can only specify one query column for the
    VALUE attribute - SO make first name and last name into one column in the query
    ....

    Not sure if there is a better way but like I said, I haven't used CFSELECT
    before.

    Zoe

    zoeski80 Guest

  6. #5

    Default Re: cfselect values

    whoops, code might help ...

    <CFQUERY NAME="tenants" Datasource ... >
    SELECT first_name + ' ' + last_name as user_name
    FROM users
    </CFQUERY>

    <CFOUTPUT>
    <CFFORM ACTION="test.cfm" METHOD="POST">

    <cfselect name="tenant" query="tenants" VALUE="user_name">
    </cfselect>

    </CFFORM>
    </CFOUTPUT>

    zoeski80 Guest

  7. #6

    Default Re: cfselect values

    Thanks that solved the problem. I never even thought about combining the 2 columns in a SQL statement prior tocalling them in the drop down menu. Typical newbie move on my behalf.
    TheEngineer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139