Our Blog

Some time ago, we made an example of two selects related in a Flash Form. We have now made a custom tag for multiple selects related. We changed the technique used in order to allow having default values already selected when the form is loaded.

Usage of tag requires a grouping tag and the selects. Each select takes a query with the values and a column for the parent.

<cfform name="multipleSelectRelatedExample" format="flash" width="400" height="200">
   <cf_multiSelectRel id="statesGroup">
      <cf_multiSelectRelControl query="states" value="stateid" display="name" label="State"
    name="selectState" selected="1" queryPosition="below">

                <option>Please select</option>
      </cf_multiSelectRelControl>
      <cf_multiSelectRelControl query="cities" value="cityid" display="name" parentcolumn="stateid" label="City"
    name="selectCity" selected="LA" queryPosition="below">
<option>Please select</option>
      </cf_multiSelectRelControl>
      <cf_multiSelectRelControl query="zips" value="zip" parentcolumn="cityid" label="Zip Code"
    name="selectZip" tooltip="Choose a zip code" style="color:##ff0000" size="2" width="70">

   </cf_multiSelectRel>
</cfform>

View live example
Download source

Update: fixed a bug when no data was preselected and added disabled attribute if we prefer to have the selects disabled until parent item is chosen

Update 2: fixed a bug when data contained a hyphen. Now there will be a problem if the data contains a ^, but I guess that will be less likely to be present :)

Laura

Laura

106 Comments

  1. kaigler
    I have been able to take our multiple select example and actually convert it to use queries from a database. It is heinously slow because of the 40k records in the database but it does what yours does but only against a database. If you are interested in the code I can send it to you.


  2. Laura
    Hi kaigler,
    The custom tag takes queries, that is any query, either manually generated (like the example, so that you can download it and test it right away), or, most likely in a real world situation, from a database.
    Does your code do something different?
  3. kaigler
    No, I thought there was a question about seeing a real query versus manually creating one like in your sample. Not a big deal. Thanks for the great resource.
  4. Wayne
    Hi Laura,

    I wanted to know if you have recieved my email regading your cod. It works great!

    If you would please have alook at the email I had send you requesting a few changes that I required.

    I dont want the selects to select a index value when it populates the select2 etc.

    Kind regards

    Wayne (South Africa)
  5. Laura
    Wayne
    This is what you need to do:
    -delete or comment out line 93 in multiSelectRel.cfm (child.dispatchEvent({type:'change'});)
    -do not use the "selected" attribute in the cf_multiSelectRelControl custom tag call

  6. Bryan
    I would love to be able to do the same thing with a cfgrid populating multiple text fields.

    How would I do this?
  7. Laura
    Bryan
    You can use binding to do that. You will bind the value of the textfields to the value of the corresponding column of the cfgrid selected item.
  8. Pam
    Hi, Laura -
    I get this code to work fine if it's the only content in a cfform, but if I put it inside a larger form (without using additional cfform tags), my page will not display. Any ideas? I appreciate any help you can give me.
    Thanks!
    Pam
  9. Pam
    Hi, Laura -
    It's Pam again - the previous post was caused by a timeout issue. I have another question - whenver I use required=&quot;yes&quot;, it does not put the red asterisk in front of the field, and it does not check to see if it was submitted. I used an empty &lt;option&gt;&lt;/option&gt; so the first one displays as a blank. This works great on a regular cfselect, but not with the custom tags. Any assistance would be greatly appreciated! Thanks!
  10. Ida
    This is a great article. I am working on something a little bit different. Is there anyway to select multiple records in the grid? Or add checkbox beside each record so that when a user clicks submit, all values go into the query? Thanks a lot.
  11. Laura
    Hi Pam,
    I updated the zip to allow adding the required and message attributes.
  12. ShyBoy

    ShyBoy

    I have a query with mutiple items, what I want is based on the 1st choice, remove that item from the list. i.e. do not display that item on the other dropdown menus.

    Could somebody help me on this
  13. Brian Rinaldi
    I posted a minor (and simple) change to the code on my blog to allow the final select box to have muliple selections. It can be found at: http://www.remotesynthesis.com/blog/index.cfm/2005/8/9/Multiple-selects-related-for-Flash-Forms--Selecting-Multiple-Elements

    Thanks as always for all your work.
  14. mdoc
    kaigler - I would love to see the code for this Custom Tag: Multiple selects related for Flash Forms using a database. This is exactly what I'm looking for...
  15. mafdoc
    if this doesn't work on databases how do I set up the data so this custom tag works?
  16. Laura
    Hello everybody,
    there seems to be a confusion about whether or not this tag works with a database.
    As I commented above, the tag takes queries. The queries make come from a database, or from anything that returns a query, a cfc, a call to cfpop, ...., or simply manually generated.
    The example in the zip file shows how to use it with a manually generated query so that you could try it right away, and not set a up a db and data source just to see how it works.
    In that example, instead of having states = queryNew()
    you would have
    <cfquery name="states">
    your sql code
    </cfquery>
    and the same for the other dependant queries.
    I hope this clarifies things a bit.
  17. George Smith
    I did get this to work with a db (1.25 million records) BUT I get an error:

    Query Of Queries runtime error.
    Comparison Exception: While executing "="
    Unsupported Type Comparison Exception: Comparator operator "=" does not support comparison between following types:
    Left hand side expression type = "STRING".
    Right hand side expression type = "LONG".

    My First select is populated with Products (char) the 2nd is state and the 3rd City. If I remove the first select it works with the state and city. (Thats how I know it works) but when I keep it in it gives me the error I am thinking that the field must be numbers. Does anyone know?
  18. George Smith
    Ok, I can now say... This works GREAT!! I did remove the isNumeric if statement from the query of query in the multiSelectRel.cfm file and it works great. I am looping over 1.5 M records. Sure is a little slow but it works. Thanks Alot.
  19. mafdoc
    Hi, I'm getting this error:
    Error Occurred While Processing Request
    Query column invalid or missing.
    You must specify the name of a column in the query "thisSelect.query" for the Display attribute of the CFSelect tag.

    The error occurred in C:\Inetpub\wwwroot\HelpDesk\multiSelectRel.cfm: line 105

    103 :    <cfif i EQ 1>
    104 :        <cfselect label="#thisSelect.label#" name="#thisSelect.name#" query="thisSelect.query" value="#thisSelect.value#" display="#thisSelect.display#"
    105 :        width="#thisSelect.width#" selected="#thisSelect.selected#" style="#thisSelect.style#"

    Could the column width from the database be too large?
  20. mafdoc
    I found the problem and corrected it.
    Now I'm getting:
    Error Occurred While Processing Request
    [Table (rows 22 columns STATE): [CITY: coldfusion.sql.QueryColumn@506848] ] is not indexable by STATE

  21. Casey A

    Casey A

    cfselect multiple=yes not working with flash format, works as intended when format is not set to flash...

    any idea what i'm doing wrong???

    <cfform name="myform" format="flash" width="650" height="850" action="sooeAuditHandle.cfm">

    <cfselect multiple="Yes" enabled="yes" queryposition="below" label="Weight allocations aligned with Measure categories" name="q5" query="auditYN" value="respValue" display="response" width="200">
    <option>Please respond</option>
    </cfselect>

    </cfform>
  22. mafdoc
    I've got it working now. This is GREAT! Thanks very much. Flash is working out fantastic for me.
  23. Laura
    Casey,
    I believe that is a bug. Specify a size greater than 1 to work around it.

    mafdoc,
    I am glad it is working for you now.
  24. Casey A

    Casey A

    OK..Got another spin on this. Please take a look at this..

    Errors:
    Error /inde.mxml:210
    Operator '<' must be followed by an operand
    Error /inde.mxml:442
    Attribute used outside class.
    Error /inde.mxml:3
    Statement block must be terminated by '}'
    Error /inde.mxml:533
    Syntax error.

    Code:
    <!--- UPDATE ROSTER RESULTS --->
    <DIV CLASS="Tab">Finalize Attendance</DIV>
    <DIV CLASS="Outlined">
    <br>

    <cfquery name="gradGrid" datasource="#application.dsn.oiws#">
    SELECT tbl_diversity_roster.racfid, tbl_diversity_roster.emplid, tbl_diversity_roster.status, tbl_diversity_roster.classNumber, last_name + ', '+ first_name AS Name
    FROM tbl_diversity_roster LEFT JOIN tbl_employee_master ON tbl_diversity_roster.emplid = tbl_employee_master.EMPLID
    </cfquery>

    <cfquery name="gradStatus" datasource="#application.dsn.oiws#">
    SELECT tbl_diversity_status.status, tbl_diversity_status.statusDescription
    FROM tbl_diversity_status
    </cfquery>

    <cfquery name="gradClass" datasource="#application.dsn.oiws#">
    SELECT tbl_diversity_classes.classNumber, classtime +' : '+ classlocation AS classInfo
    FROM tbl_diversity_classes
    </cfquery>


    <table border=1 height=170><tr><td>
    <cfform format="Flash">
       <cfgrid name="UsersGrid" format="Flash" query="gradGrid" maxRows="5" rowheaders="Yes" onchange="for (var i:Number = 0; i<#emplid#.length; i++) { if (#emplid#.getItemAt([i]).data == UsersGrid.selectedItem.#emplid#) #emplid#.selectedIndex = i}">
          <cfgridcolumn name="Name" header="Name">
           <cfgridcolumn name="emplid" header="EE ID" select="false">
          <cfgridcolumn name="classNumber" header="Class" select="true">
          <cfgridcolumn name="status" header="Status" select="true">
       </cfgrid>

    <cfselect name="classNumber" width="200" size="1" label="Class" onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'classNumber', classNumber.selectedItem.data);" query="gradClass" display="classInfo" value="classNumber">
    </cfselect>

    <cfselect name="status" width="200" size="1" label="Status" onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'status', status.selectedItem.data);" query="gradStatus" display="statusDescription" value="status">
    </cfselect>

    <cfformgroup type="horizontal">
    <cfinput type="Submit" name="submitBtn" value="Save" action="diversityEE_grid.cfm">
    </cfformgroup>

    </cfform>
  25. Casey A

    Casey A

    Down to two errors!

    2 Errors found.
    Error /inde.mxml:210
    There is no property with the name 'EMPLID'.
    Error /inde.mxml:212
    There is no property with the name 'EMPLID'.

    <cfquery name="gradGrid" datasource="#application.dsn.oiws#">
    SELECT tbl_diversity_roster.racfid, tbl_diversity_roster.EMPLID, tbl_diversity_roster.status, tbl_diversity_roster.classNumber, last_name + ', '+ first_name AS Name
    FROM tbl_diversity_roster LEFT JOIN tbl_employee_master ON tbl_diversity_roster.emplid = tbl_employee_master.EMPLID
    </cfquery>

    <cfquery name="gradStatus" datasource="#application.dsn.oiws#">
    SELECT tbl_diversity_status.status, tbl_diversity_status.statusDescription
    FROM tbl_diversity_status
    </cfquery>

    <cfquery name="gradClass" datasource="#application.dsn.oiws#">
    SELECT tbl_diversity_classes.classNumber, classtime +' : '+ classlocation AS classInfo
    FROM tbl_diversity_classes
    </cfquery>


    <table border=1 height=170><tr><td>
    <cfform format="Flash">
       <cfgrid name="UsersGrid" format="Flash" query="gradGrid" maxRows="5" rowheaders="Yes"
    onchange="for (var i:Number = 0; i<EMPLID.length; i++) {if
    (EMPLID.getItemAt().data == UsersGrid.selectedItem.EMPLID)
    EMPLID.selectedIndex = i}">
          <cfgridcolumn name="Name" header="Name">
           <cfgridcolumn name="EMPLID" header="EE ID" select="false">
          <cfgridcolumn name="classNumber" header="Class" select="true">
          <cfgridcolumn name="status" header="Status" select="true">
       </cfgrid>

    <cfselect name="classNumber" width="200" size="1" label="Class" onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'classNumber',

    classNumber.selectedItem.data);" query="gradClass" display="classInfo" value="classNumber">
    </cfselect>

    <cfselect name="status" width="200" size="1" label="Status" onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'status', status.selectedItem.data);"

    query="gradStatus" display="statusDescription" value="status">
    </cfselect>

    <cfformgroup type="horizontal">
    <cfinput type="Submit" name="submitBtn" value="Save" action="diversityEE_grid.cfm">
    </cfformgroup>

    </cfform>
  26. Laura
    Casey,
    It seems that you want to bind a column of your grid to one select. So the onchange attribute of your grid is looking for a select called EMPID. You do not have any select with that name.
    If you wanted to bind to your status select, then you would write:
    onchange="for (var i:Number = 0; i< status.length; i++) {if (status.getItemAt().data == UsersGrid.selectedItem.status)
    status.selectedIndex = i}"
    provided that the status column in your query is lower case (if it is not, then change UsersGrid.selectedItem.STATUS, or whatever the correct case is)

    Hope that helps
  27. Casey A

    Casey A

    AHH! Laura, you are a genius!
    The only thing that's giving me heartburn now is the onChange event of my classNumber select. It's not changing when I pick different students. The status updates just fine now.

    <cfquery name="gradClass" datasource="#application.dsn.oiws#">
    SELECT classNumber, classtime +' : '+ classlocation AS classInfo
    FROM tbl_diversity_classes
    ORDER BY classNumber
    </cfquery>


    <table border=1 height=200><tr><td valign=top>
    <cfform format="Flash" width="600" height="200">
       <cfgrid name="UsersGrid" format="Flash" query="gradGrid" maxRows="10" height="100" rowheaders="No"
    onchange="for (var i:Number = 0; i<status.length; i++) {if (status.getItemAt([i]).data == UsersGrid.selectedItem.status)
    status.selectedIndex = i}">
          <cfgridcolumn name="Name" header="Name">
           <cfgridcolumn name="emplid" header="EE ID">
          <cfgridcolumn name="classNumber" header="Class">
          <cfgridcolumn name="status" header="Status">
       </cfgrid>

    <cfselect name="classNumber" width="300" size="1" label="Class" onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'classNumber',

    classNumber.selectedItem.data);" query="gradClass" display="classInfo" value="classNumber">

    </cfselect>

    <cfselect name="status" width="300" size="1" label="Status"
    onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'status', status.selectedItem.data);" query="gradStatus" display="statusDescription" value="status">


    </cfselect>

    <cfformgroup type="horizontal">
    <cfinput type="Submit" name="submitBtn" value="Save" action="diversityEE_grid.cfm">
    </cfformgroup>

    </cfform>
  28. Casey A

    Casey A

    Laura,

    I re-read your explanation. Based on what I understand, the onchange event in the grid is bound to the one cfselect. Any way to expand that functionality to both cfselects? I ask because these two elements will be edited by my users, the onchange event of the cfselect is working...It's the onchange event of the grid that isn't bound to both selects.
  29. mafdoc

    mafdoc

    hi,
    I've got a cf_multiselect on my cfform. Then I have another one on a tabnavigator. They both work fine. When I try to add another set on the same tabnavigator, I can't. Is there a way to get more than one on the form. I tried to name them but this didn't work.
    Thanks for any help.
  30. Casey A

    Casey A

    Hey guys, I seem to be missing records in the recordset:
    Not sure if it's noteworthy but 'status' is a numeric field, always 1 digit in length.
    I think it's either a problem with the gradGrid query or the onChange statement of the UsersGrid. Any advice is appreciated.

    <cfquery name="gradGrid" datasource="#application.dsn.oiws#">
    SELECT *, tbl_diversity_roster.racfid, tbl_diversity_roster.status, tbl_diversity_roster.classNumber, tbl_employee_master.LAST_NAME + ', ' +

    tbl_employee_master.FIRST_NAME as Name, tbl_employee_master.EMPLID
    FROM tbl_diversity_roster LEFT JOIN tbl_employee_master ON tbl_diversity_roster.emplid = tbl_employee_master.EMPLID
    </cfquery>

    <cfquery name="gradStatus" datasource="#application.dsn.oiws#">
    SELECT tbl_diversity_status.status, tbl_diversity_status.statusDescription
    FROM tbl_diversity_status
    </cfquery>

    <cfquery name="gradClass" datasource="#application.dsn.oiws#">
    SELECT classNumber, classNumber +' : '+ classtime +' : '+ classlocation AS classInfo
    FROM tbl_diversity_classes
    ORDER BY classNumber
    </cfquery>


    <table border=1 height=200><tr><td valign=top>
    <cfform format="Flash" width="600" height="200" action="diversityFin_grid.cfm">
       <cfgrid name="UsersGrid" format="Flash" query="gradGrid" maxRows="10" height="100" rowheaders="No" selectmode="edit"
    onchange="for (var i:Number = 0; i < status.length; i++) {if (status.getItemAt([i]).data == UsersGrid.selectedItem.status)
    status.selectedIndex = i}">
          <cfgridcolumn name="Name" header="Name" select="false">
           <cfgridcolumn name="EMPLID" header="EE ID" select="false">
          <cfgridcolumn name="classNumber" header="Class" select="false">
          <cfgridcolumn name="status" header="Status" select="false">
       </cfgrid>

    <cfselect name="classNumber" width="350" size="1" label="Class"
    onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'classNumber', classNumber.selectedItem.data);" query="gradClass" display="classInfo"

    value="classNumber"> </cfselect>

    <cfselect name="status" width="100" size="1" label="Status"
    onchange="UsersGrid.dataProvider.editField(UsersGrid.selectedIndex, 'status', status.selectedItem.data);" query="gradStatus" display="statusDescription" value="status">

    </cfselect>

    <cfformgroup type="horizontal">
    <cfinput type="Submit" name="submitBtn" value="Save Changes" action="diversityFin_grid.cfm">
    </cfformgroup>
  31. mafdoc

    mafdoc

    Hello, I am still trying to figure out how to have many cf_multiSelect (s) on the same form.
    I am trying to duplicate the custom tags to
    cf_multiSelectResolution and cf_multiSelectResolutionControl. But I am getting this error:

    Element NAME is undefined in a Java object of type class coldfusion.runtime.AttributeCollection referenced as


    The error occurred in C:\Inetpub\wwwroot\myfolder\multiSelectResolution.cfm: line 79
    Called from C:\Inetpub\wwwroot\myfolder\myform.cfm: line 266
    Called from C:\Inetpub\wwwroot\myfolder\myform.cfm: line 216
    Called from C:\Inetpub\wwwroot\myfolder\myform.cfm: line 147
    Called from C:\Inetpub\wwwroot\myfolder\myform.cfm: line 146
    Called from C:\Inetpub\wwwroot\myfolder\myform.cfm: line 1

    77 :    <cfsavecontent variable="actionPopulate">
    78 :       <cfoutput>   
    79 :    var child = #thistag.selects[i+1].name#;
    80 :    var parent = #thistag.selects[i].name#;
    81 :    var parentColName = "parent#i+1#";

    Any assistance would be greatly appreciated.
    Thanks
  32. Casey A

    Casey A

    Guys... I'm almost embarassed to admit this... The reason why I was not able to show all my results in the grid...

    maxRows=&quot;10&quot;

    doh....
  33. mafdoc

    mafdoc

    I would really like to use two multiselects in different places on the same form. As stated above, I duplicated the cf_multiSelectRel and cf_multiSelectRelControl. Do I also need to duplicate the ArrayConcat.cfm?

    Thanks for any help.
  34. Laura
    mafdoc,

    You shouldn't need to duplicate anything at all, just write two calls to the custom tag as described in the example. Just make sure that you are assigning a different id to each of the top tags:
    <cf_multiSelectRel id="states">
    It is in the zip, I don't know why I forgot to write it in the example in the post. I am fixing it right now.
  35. mafdoc
    Thanks so much.
    I had tried to add name="states" and didn't know it was id="states"
    It's working great.
    Thanks again.
  36. David
    Is there a way to speed up the selects? I have 3 queries that i cache but even after i do so it takes about 20 secs to go from one drop down to the next. I have about 40k records to sort through on the deepest one with only about 100 or so actually showing up in the list. Any suggestions?
    Thanks!
    David

    Great Site btw!!! :)
  37. David,
    Sorry, but Flash can not handle 40k of records. Maybe you can split the whole query and separate them by groups.
  38. Justin Cook

    Justin Cook

    I'm getting some of the same errors as mafdoc, but unfortunately, I haven't found an answer to my problem yet. First off, let me say I am trying to use this by pulling from a database. After I put in my queries, I get the error:

    Query column invalid or missing.
    You must specify the name of a column in the query "thisSelect.query" for the Display attribute of the CFSelect tag.

    Anyone have a clue on this? Your help is mucho appreciated!

    Thanks,
    Justin
  39. mafdoc
    Let me try to explain what I would like to do…

    I have State, City, Zip - multipleselects. Working great! Love them!
    Now I want to set up another selection field that will set these to a default on what is selected here.
    EX: Field: Vendor Name
    Select: ABC Co.
    Digital Co.
    BlahBlah Co.
    Depending on which is selected.
    Set the State, City, Zip. While still using the multipleselects as is. Possible?

    I know how to do this with the grid and bind but I need to do both -set the defaults if the Co.’s are listed and if they are not listed -select each one manually.
    Any ideas or pointers would be appreciated.
  40. mafdoc
    Justin,
    If you post your query and this part of your code, maybe we can see what is missing.
  41. gaindauz

    gaindauz

    How to add 'select all' option in each selected option?
  42. George Smith
    I am trying to use the multi tag and it works good pulling the brands. when I select a brand then the states list works good but the 3rd selection; city does not pull the right cities. What could I be doing wrong?

    Here is my code:

    <cfquery datasource="BDN" name="BDN">
    SELECT DISTINCT COMC5W, COMCDE, STATWF, CITYWF
    FROM BDN
    </cfquery>   


    <cfquery dbtype="query" name="Brand">
    SELECT DISTINCT COMC5W, COMCDE
    FROM BDN
    ORDER BY COMCDE
    </cfquery>

       
    <cfquery dbtype="query" name="State">
    SELECT DISTINCT STATWF, COMC5W
    FROM BDN
    ORDER BY STATWF
    </cfquery>

    <cfquery dbtype="query" name="City">
    SELECT DISTINCT STATWF, CITYWF
    FROM BDN
    ORDER BY CITYWF
    </cfquery>

    <cfform name="Locator" format="flash" skin="haloblue" width="350" height="350" action="RunLocator.cfm" target="_blank">

    <cfformgroup type="tabnavigator" style="background-color:##ECF5FF;" height="225">
    <cfformgroup type="page" label="City">

    <cfformgroup type="vbox">
    <cfformgroup type="horizontal">
    <cf_multiSelectRel>

    <cf_multiSelectRelControl query="Brand" value="COMC5W" display="COMCDE" label="Brand "
    name="selectBrand" queryPosition="below" width="225">
    <option></option>
    </cf_multiSelectRelControl>

    <cf_multiSelectRelControl query="State" value="STATWF" display="STATWF" parentcolumn="COMC5W" label="State "
    name="selectState" queryPosition="below" width="45"> <option></option>
    </cf_multiSelectRelControl>
       
    <cf_multiSelectRelControl query="City" value="CITYWF" parentcolumn="STATWF" label="City "
    name="selectCity" queryPosition="below" width="225" size="4"> <option></option>
        </cf_multiSelectRelControl>
       
    </cf_multiSelectRel>
    </cfformgroup>
    </cfformgroup>
        </cfformgroup>
    <cfformgroup type="page" label="Zip">
    <cfformgroup type="horizontal">
    <cfselect query="Brand" name="Brand" value="COMC5W" display="COMCDE" label="Brand " width="225" queryPosition="below"><option></option></cfselect>
    </cfformgroup>
    <cfformgroup type="horizontal">
    <cfinput type="text" name="Zip" width="60" label="Zip Code">
    <cfselect name="Radius" width="50" label="Radius (miles)">
    <option>5</option>5
    <option>10</option>10
    <option>25</option>25
    </cfselect>
    <cfinput type="Hidden" value="zipcode" name="order" width="0">


    </cfformgroup>
    </cfformgroup>

    </cfformgroup>
    <cfformgroup type="horizontal">
    <cfformitem type="spacer" width="200" />
    <cfinput type="radio" name="Format" label="HTML" value="HTML" checked="true">
    <cfinput type="radio" name="Format" label="XLS" value="XLS">
    </cfformgroup>
    <cfformgroup type="horizontal">
    <cfformitem type="spacer" width="200" />
    <cfinput name="btnSubmit" type="submit" value="Submit" width="50">
    <cfinput name="btnSubmit4" type="reset" value="Clear" width="50">
    </cfformgroup>

    </cfform>

    you can see it at www.youngsmarket.com/index4.cfm

    Thanks
  43. George
    Well I thought I got It. I do see my problem. My app. is supposed to find where brands are sold. First you select Brand then the state then the city. All works well but the list of cities is a list of ALL the cities in that state. I was hoping that the list would only include cities that have the selected brand. So in that... How do I hold onto the first selected variable (brand) so the cities displayed are only the cities that bought the brand? my code is above this post. Thanks
  44. Job
    Hello,

    I am looking into a way to make a location-selector similar to George's, but based on country/state or province/city. One has to be able to select any city anywhere on the globe. (nope, I'm not modest ;)

    What I see as a problem in the above solution - or I have not fully understood it - is that all the query-data is being pulled from the database when the .cfm executes, so it is available to the flash-form. (and the selectboxes can than be changed depending on previous selection)

    In my case I would think it becomes quite a big load, if I have to load in some 35000+ cities in advance...

    Is it possible to populate a selectbox on 'runtime'? So the appropriate query only executes when requested? By maybe calling a separate .cfm that only builds the right query and sending it back?

    Any thought are welcome...
    Thanks, best,

    Job


  45. mafdoc
    I have a 3 level multiselects. Category, Type, and Item

    Everything is working fine.
    What I need to do is set these if another field is selected.
    So I’ve got a “Problem Type” field. If someone selects from this field,
    I want to default the Category, Type and Item fields.
    If there is no selection, then I need to have the Category, Type and Item fields selected manually.

    I made the Problem Type field a grid and once selected, I bind PT_Category, PT_Type, PT_Item fields to the defaulted values.
    Is there a way to either do a cfif or an ActionScript in the multiselect code and bind if the selection is made or is there a way to hide the multiselect fields when the Problem Type field is selected??

    I have the AS for Flash MX book but am waiting for a class to come to my area.
    Any help or direction would be greatly appreciated.
  46. mafdoc
    Okay, I wrote my first action script.
    <cfsavecontent variable="hidecti">
    selectcat._visible = false;
    selecttype._visible = false;
    selectitem._visible = false;
    </cfsavecontent>

    AND the onChange works some. When the selection is made, the fields disappear but the labels still show.
    Any help on how to hide the labels?
  47. mafdoc
    I found out how to default the multiselects fields to the selection of the Problem Type field. Just use the bind statement.

    <cfsavecontent variable="autofill">
    category.text = summary.dataProvider[summary.selectedIndex]['category'];
    type.text = summary.dataProvider[summary.selectedIndex]['type'];
    item.text = summary.dataProvider[summary.selectedIndex]['item'];
    </cfsavecontent>

    Then on the Problem Type field onChange="#autofill#".
  48. BM
    Having a problem with using 3 selects. Two work fine but when I attempt to add a third, I get a db error:

    [Table (rows 32 columns Sector): [Sector: coldfusion.sql.QueryColumn@1c7d181] ] is not indexable by District

    And it references the following:

    The error occurred in D:\Inetpub\cgweb\Lantarea\PWCS\main\customtags\multiSelectRel.cfm:

    150 :       <cfset vals = listtoarray(arrayToList(thistag.selects[i].query[thistag.selects[i].parentcolumn],"^"),"^")/>

    Any help here? Will I need to modify the tag to allow for three selects?
  49. bill
    Hi guys,
    It's great piece of code. It works fine.
    My problem is how to preselect values and highlight them in the select boxes and how to keep values selected in them after submitting the form.
    Thanks,
    bill d.
  50. Terri Yonich

    Terri Yonich

    Hello all,

    I was wondering if anyone tried to write a conditional statement within the form. Based on the first selection, I need the second and third selections to change, based on the ID. Problem is....data is generated from two different sets of relations tables. I am new to CFMX7 and really need some help with this: Here are the queries and data:

    <cfquery name="category" datasource="">
    select *
    from category_master
    where categoryID in (3,4)
    </cfquery>

    <cfquery name="subcat" datasource="">
    select *
    from Sub_category
    </cfquery>

    <cfquery name="sub_subcat" datasource="">
    select *
    from Sub_SubCategory
    order by sub_subcategory
    </cfquery>

    <cfquery name="ind" datasource="">
    select distinct industryID, industry
    from coatings
    </cfquery>

    <cfquery name="exposure" datasource="">
    select distinct exposureID, exposure, industryID
    from coatings
    </cfquery>

    <cfquery name="substrate" datasource="">
    select distinct substrateID, substrate, exposureID
    from coatings
    </cfquery>

    <cfform name="cat" format="flash" action="process.cfm" width="80%" height="660">

    <cf_multiSelectRel id="states">
          <cf_multiSelectRelControl query="category" value="categoryID" display="category_name" label="Category:"
        name="selectCategory" selected="" queryPosition="below" required="true" message="This field is required" width="300"><option selected>Please Select One               
          </cf_multiSelectRelControl>

    <cfif isdefined("selectCategory") and selectCategory EQ 3>
    <cf_multiSelectRel id="ind">

    <cf_multiSelectRelControl query="ind" value="industryID" display="industry" label=""
        name="selectIndustry" selected="" queryPosition="below" required="true" message="This field is required" width="300">
          </cf_multiSelectRelControl>

    <cf_multiSelectRelControl query="exposure" value="exposureID" display="exposure" parentcolumn="industryid" label=""
        name="selectexposure"queryPosition="below" width="300">
          </cf_multiSelectRelControl>   

    <cf_multiSelectRelControl query="substrate" value="substrateID" display="substrate" parentcolumn="exposureid" label=""
        name="selectexposuresub" tooltip="Choose a Substrate" style="color:##ff0000" size="2" width="300">
       </cf_multiSelectRel>       
          
    <cfelseif isdefined("selectCategory") and selectCategory EQ 4>

    <cf_multiSelectRelControl query="subcat" value="subcatID" display="subcategory" parentcolumn="categoryid" label=""
        name="selectSubcategory"queryPosition="below" width="300">
          </cf_multiSelectRelControl>   

          <cf_multiSelectRelControl query="sub_subcat" value="sub_subcatID" display="sub_subcategory" parentcolumn="subcatid" label=""
        name="selectSubsubcategory" tooltip="Choose a SubCategory code" style="color:##ff0000" size="2" width="300">
       </cfif>
    </cf_multiSelectRel>

    </cfform>

    Any help from anyone would be appreciated. Thanks to all in advance.
  51. question4me

    I have a cfform that is a width 700. All my forms align correctly on the page within a panel. When I put this multiselect, the whole form goes out of whack where its a fraction of the 700 width and its centered. If i set a width for each field eventually I can guess a good width to stretch the field to somewhat align with the other inputs. Is there some other way to accomplish this? Am I doing something wrong?
  52. question4me

    Sorry I meant to say all my inputs align correctly on the page.
  53. Javier Julio
    The project I'm working on is using this custom tag but we have run into freezing problems. The three drop downs we have populate just fine and preselect values (although they don't have too - did this just to mimic your example files). I have gone as far as removing everything except the cfform tag so only the 3 drop downs are in my code. I'm even using the same query data as your example but I get the same issue. When I select an item from any of the drop down menus the flash form freezes. It freezes and I cannot choose any other control, not even that one. All I can do is reload the page and try again to solve the problem but no luck. I did get the most recent updated code but I'm still having these freezing/locking up issues. Has anyone else come across this?? Thanks in advance.
  54. Javier Julio
    Issue fixed about the freezing but I still have a question. If I have three drop downs I need to incorporate an onchange event on the third one. How do I do that with your customTag?? I have added a new attribute to the customTag called onChange and gave it a default value of nothing in the multiSelectRelControl.cfm file so I don't need it defined if I'm not using it. But I'm not sure how to get the multiSelectRel.cfm to appead my onchange AS code?? Where do I do that?? I figured it'd be in the cfelse statement of line 98 of that file but nothing happens. I did a simple alert('Hello'); for testing but I got nothing, any idea how to implement this??
  55. Kevin
    I have an auto application similar to the real estate application on this site and I have incorporated the Multi Select for the MAKE/MODEL/TRIM of the Auto. When a user clicks on a row in the results grid is there a way to populate the multiselects? What I am finding is that it will populate the First Field(MAKE), but becuase the field was loaded with the value and not &quot;CHANGED&quot; the onChange function which would normally populate the next fields is not working.
    Is there a way to get this to work?
  56. Seth
    I have the same issue as question4me, with the cfform being resized and centered on the page.

    Any idea why this is happening? When I remove the tag the form is the correct width and left aligned, when I put the tag in it is centered and only 300px wide.

    Thanks
  57. George
    Maybe I am not explaining whats happening good enough. I have 3 selects (distributor, brand, item) I pick a distributor and then the first record automaticaly fills in the brand and item. I just want it to say "Select All" until a choice is made. Is there a way to do this? Thanks.
  58. Raphael Anzenberger

    Raphael Anzenberger

    George,

    Did you get a solution for your problem? I am facing the same issue.

    Raphael
  59. Terri Yonich
    George,

    Have you tried adding this after each cfselect statement:

    <option value="0" selected>Select All

    Not sure if this is what you are going for?
  60. George
    Thanks, but I could not get that to work. I tried to put selected="0" in the multiSelectRelControl statment, but get an error, I tried a few different ways but non seems to work. Terri does the statement you send work for you? I am stumped. Any help will help though, Thanks
  61. Raphael Anzenberger

    George,

    I got it: add to multiSelectRel.cfm @ line 84 after var displayCol = &quot;display#i+1#&quot;;:
    var defaultdisplayCol = 'Choose one';
    var defaultvalueCol = '';

    and after child.removeAll();:
    child.addItem(defaultdisplayCol,defaultvalueCol);

    Should do the trick!

    Raphael.
  62. Luke
    Hi
    This is just what I need but I'm having the same problems as Seth and question4me
    Adding the Custom tag completly ruins my layout
    Is thewre a work around?
  63. George Lu

    George Lu

    Hi,

    I've tried to populate the data from database and use custom tag to do cfselects. But I've got this error:

    [Table (rows 3 columns ID_CAT2, NAME_CAT2): [ID_CAT2: coldfusion.sql.QueryColumn@9ac9d6] [NAME_CAT2: coldfusion.sql.QueryColumn@393641] ] is not indexable by ID_cat1

    Here is my code (I've used cfc for queries but list all queries here):

    <CFQUERY NAME="qGetCategory1" DATASOURCE="#request.app.dsn#">
       SELECT ID_cat1, Name_cat1
       FROM tblCategory1
    </CFQUERY>
    <CFQUERY NAME="qGetRelatedCategory2" DATASOURCE="#request.app.dsn#">
       SELECT ID_cat2, Name_cat2
       FROM tblCategory2
    </CFQUERY>
    <CFQUERY NAME="qGetRelatedCategory3" DATASOURCE="#request.app.dsn#">
       SELECT ID_cat3, Name_cat3
       FROM tblCategory3
    </CFQUERY>
    <CFQUERY NAME="qGetRelatedCategory4" DATASOURCE="#request.app.dsn#">
       SELECT ID_cat4, Name_cat4
       FROM tblCategory4
    </CFQUERY>

    <CFFORM name="ISURequest" action="formCFmail.cfm" method="post">

       <cf_multiSelectRel id="qGetCategory1">
             <cf_multiSelectRelControl query="qGetCategory1" value="ID_cat1" display="Name_cat1" label="Request Type"
                       name="ID_cat1" queryPosition="below" required="true" message="This field is required">
                       <OPTION>-- Select one --</OPTION>
             </cf_multiSelectRelControl>

             <cf_multiSelectRelControl query="qGetRelatedCategory2" value="ID_cat2" display="Name_cat2" parentcolumn="ID_cat1" label="Service Group"
                       name="ID_cat2" queryPosition="below">
                       <OPTION>-- Select one --</OPTION>
             </cf_multiSelectRelControl>
             
             <cf_multiSelectRelControl query="qGetRelatedCategory3" value="ID_cat3" display="Name_cat3" parentcolumn="ID_cat2" label="Service"
                       name="ID_cat3" queryPosition="below">
                       <OPTION>-- Select one --</OPTION>
             </cf_multiSelectRelControl>
             
             <cf_multiSelectRelControl query="qGetRelatedCategory4" value="ID_cat4" parentcolumn="ID_cat3" label="Item (optional)"
                       name="ID_cat4" tooltip="Choose a zip code" style="color:##ff0000" size="6" width="200">
          </cf_multiSelectRel>
       <cfinput type="Submit" name="submit" value="Submit">
    </CFFORM>

    Please help!
  64. George Lu

    George Lu

    It's ok now. I need to add parentcolumn to each query.

    Thanks.
  65. Luke
    Hi,
    I might be trying to be over ambitious, but I would like to bind the selected item of the cf_multiSelectRelControl to the selectedItem in a grid.
    Something like selected="{gridCountry.selectedItem.CountryID}"
    Am I missing something or is this not possible?
    Many thanks in avanced.
    Luke
  66. Thomary

    Thomary

    I am no way an expert but I got this on another blog... Put this in the onchange of the grid...
    onchange="{cfmultiselect1.selectedIndex=0}{cfmultiselect2.selectedIndex=0}
    for(var i:Number = 0; i<cfmultiselect1.length; i++) {if(cfmultiselect1.getItemAt([i]).data==gridname.selectedItem.columnname)cfmultiselect1.selectedIndex=i}
    for(var i:Number = 0; i<cfmultiselect2.length; i++) {if(cfmultiselect2.getItemAt([i]).data==gridname.selectedItem.columnname2)cfmultiselect2.selectedIndex=i}"

    Don't know if it will work on multiselects but it worked on my regular cfselects. I had 4 I was doing. HTH
  67. Rodrigo
    Hi all...

    Is there a way to put for the 2 cfselect side by side instead of one on the top of the other?
  68. Daniel
    i have three selects:
    first is some sort of kategorie
    second is a related sub kategorie
    and third is a manifacturer witch is releated to the kategorie

    Question:
    is it possible to bind two selects on the first one ??
  69. George Lu

    George Lu

    Is it possible to display some kind of tooltips embed with links relating to the data in the select list?
  70. Ken
    I'm having the same problem MAFDOC had on Aug. 25. I converted the example code to use CFQUERY tags and now I get the error &quot; The error occurred in ...\multiSelectRel.cfm: line 105. Query column invalid or missing.
    You must specify the name of a column in the query &quot;thisSelect.query&quot; for the Value attribute of the CFSelect tag.&quot;

    Any idea what the solution is?

    Thx
    Ken
  71. Seth
    I have resolved the form resizing issue. The fix was to add width attributes to each of the 'pages' that the tag is on. I was using with the accordion feature . . .
  72. George
    I have been using the tag for a while and it works well for me. I do have a speed issue. I put my queries in a CFC. 2 of the cffunctions make a request from the same DB. I was thinking I could use a query of query but cannot seem to get that to work. Does anyone have any other ideas? Would Flash Remoting speed it up. Or how about and argument in the function coming from the mutiSelect tag. if thats possible how or should I say what would the argument names be?
    Thanks a always

    George
  73. Ken
    I'm trying to get the second drop down list of a 2-part related select to default to the word "(Optional)". It works fine when the page loads, but if I change the first selection, the second selection goes to the first item that starts with "A___". The query for the second select has been ordered which means "(" should appear before "A". It works on about half of the first selections and doesn't work on the other half. Any ideas?

    <cf_multiSelectRel id="Services">
    <cf_multiSelectRelControl query="qryGetLocations" value="LocationID" display="name" label="Location" name="LocationID" selected="#loc#" queryPosition="below" required="false"> <option>Please select location</option>
    </cf_multiSelectRelControl>
    <cf_multiSelectRelControl query="qryGetServices" value="Service" display="Service" parentcolumn="LocationID" label="Service" name="Service" selected="(Optional)" queryPosition="below"> </cf_multiSelectRelControl>
    </cf_multiSelectRel>
  74. thomary

    thomary

    I am trying to set the classsite and neodatereq fields on my form on change of grid. Here is my onchange code:

    for(var i:Number = 0; i<classsite.length; i++)
    {if(classsite.getItemAt([i]).data==data.selectedItem.neo_site_requested)classsite.selectedIndex=i}
    for(var i:Number = 0; i<neodatereq.length; i++)
    {if(neodatereq.getItemAt([i]).data==data.selectedItem.neo_date_requested)neodatereq.selectedIndex=i}

    Here is my multiselect code:

    <cf_multiSelectRel id="classsitedate">
    <cf_multiSelectRelControl name="classsite" display="site" label="Class Site"
    query="class_site" value="site" queryPosition="below" width="150" required="true">
    <option value="Select"> </option>
    </cf_multiSelectRelControl>
    <cf_multiSelectRelControl name="neodatereq" display="date" label="NEO Date Requested"
    query="class_date" value="date" parentcolumn="site" queryPosition="below" width="150"
       required="true">
    <option value="Select"> </option>
    </cf_multiSelectRelControl>
    </cf_multiSelectRel>

    My problem is the second multiselect does not fill onchange of the grid? The first one does fill properly. The cases are correct. Any help would be greatly appreciate.
  75. thomary

    thomary

    It looks like Nahuel and Laura stopped monitoring this blog in Sept 2005. ???

    Ken: I'm not very good at this but I think you need to update your database (or whatever you are querying) to show "Optional" on each posible selection.

    I need help with the required option. I have the multiselect as required="yes" and the asterisk shows but the form can be submitted without any data in these fields.
    Any help would be greatly appreciated.
  76. thomary

    thomary

    A coworker looked at my code and found my problem with the required attribute. It wasn't working because I put in
    <option value="Select"> </option>
    I thought this allowed me to have a blank for the first selection -which it did but it also defaulted the field with "Select". I changed the code to:
    <option value=""> </option>
    I still have the blank for the first selection and the requirement now works.

    Thanks to you for the custom tag and it works even better now that I got an education from my coworker. I told you I'm not good with this...
  77. thomary

    thomary

    H E L P

    Custom tag MultiSelect required problems persist:

    I have mutliselect fields that I need to fill onchange on a Grid. The first loads fine with no problems. It's the second multiselect.
    I got the data to load by using:
    datereq.text = data.dataProvider[data.selectedIndex]['date_requested'];

    In the onChange of the grid.

    The data gets filled in but when the user goes to update, the Message shows as if there is no data in the field. Is there anyway to bring the data back with the onchange of the grid?
    My grid name is data.
    My form field name is datereq.
    My mysql database name is date_requested.

    Any help would be greatly appreciated.
  78. thomary

    thomary

    I found something that works.

    <cf_multiSelectRel id="classsitedate">

    <cf_multiSelectRelControl name="classsite" display="site" label="Class Site" query="class_site" value="site" queryPosition="below" width="150" required="true">
    <option value=""> </option>
    </cf_multiSelectRelControl>

    <cf_multiSelectRelControl name="neodatereq" display="date" label="NEO Date Requested"
    query="class_date" value="date" parentcolumn="site" queryPosition="below" width="150"
    required="true">

    <option value=""> </option>
    </cf_multiSelectRelControl>

    </cf_multiSelectRel>


    I removed this line on the second multiselect and the update works fine now.

    <option value=""> </option>

    Hope this helps those that are novices like me....
  79. thomary

    thomary

    I have to thank Raphael Anzenberger for that added code you provided. It worked great for me. Thank you so much.

    Of course, I need a tweak to it. I have a third level in the multiselect. It works fine but when a user selects all three - then decides on a different set.

    The first select resets the second to Choose one. BUT the third select keeps what was selected initially.
    Once the second one changes then the third select changes to Choose one.

    Anyway to get the third select to clear (or chg to Choose one) on the first select?
  80. Stace
    OK,
    I have a form thats getting turned into a .pdf no database
    I dont want them to have to fill out duplicate info.
    so onClick = "tweedledee.text = tweedledumb.text" works well for moving text from on feild to anouther.
    How do I get the same thing to happen with cfselect.
    .text = .text will work on it in the form but the output ends up displaying as selected=
  81. Stace
    Sorry consulted my dom reference figured it out.
  82. JR
    Hi
    when i use queries the selected field is not working
    so at start up in the tow selects i have please select and not the options i want
    ((((the code is working fine but the selected is not))))
    my queries are:
    <cfquery name="states">
    select id as stateid, country_name as name
    from countries
    </cfquery>
    <cfquery name="cities">
    select id as cityid, country_id as stateid,city_name as name
    from cities
    </cfquery>

    i say again:
    ((((the code is working fine but the selected is not))))

    please Help
  83. JR
    by the way

    all the other code is exactly like the example for this page
  84. Maggie
    Hi all,

    I'm using cfselect multiple="yes", and submitting all of my form date via flash remoting. If I select, let's say, three options, and submit them via the POST method, I will get a comma delimited list of the values (i.e. - 1, 2, 3).

    However, when I obtain the value from flash remoting using selectFieldName.value, I only get the highest value selected in the example case, I would only return 3. My question is - how can I get that same comma delimited list using the AS vars?

    Thanks in advance for any help!
  85. Scott
    Greetings.

    The code works great and I now need to tweak it a bit to allow for two parents.

    Example:

    The first select shows Coutries;The second select shows States; The Third select shows Cities

    My issue; most, but not all cities (Washington D.C.) have a State. In this case D.C. does not show up, because D.C. is associated with the country U.S. and not a state.

    So I need the ability to associate with multiple parents..??

    Any ideas?
  86. Dai
    can I take variables from all three boxes and pass them to another page to be used in a query.

    example if the boxes were

    first box = resort
    second box = hotel name
    third box = board type (selc catering, half board, etc)

    could I pass all thre variable sto the next page?
  87. Maggie
    Hello,

    Can someone please help? I'm pulling my hair out with this one - I have two <cfselect multiple="yes"> select boxes (one has a size of 6, one has a size of 12). They were both working fine, until I used a <cfformgroup type="accordion">!!! Basically I have structured the page so that the initial datagrid displays in the first accordion pane; you select an option and are taken to the action panels in the second accordion pane below.

    I've done a great deal of work on this layout, and have spent hours whittling away all of the code, just to find that when I comment out the accordion, the <cfselect multiple="yes"> works. However, this is not an acceptable workaround for me, as I need to work within the resolution of the page. Is there any known workaround for this? Please???
  88. Tony
    Hi Everyone,

    I have a question regarding the cfselect tag. Does the 'multiple' attribute of the cfselect work? Because I have a cfselect with the multiple attribute set to 'yes' with a size of 5 and I can't select muliple items in the list. Here is my code:

    <cfselect name="venueList" width="140" value="Venue" label="Venue:" query="q_venues" required="yes" message="You need to specify a Venue" style="#text#" multiple="yes" size="5"></cfselect>

    As you can see I'm populating the cfselect with a query - I try keeping in control/alt/shift to select multiple items but nothing works.

    Any idea what I'm doing wrong?

    Thanks for your time,

    - Tony

    PS: This site rocks!
  89. Wyldtwyst
    Laura,

    I love this custom tag. Is there any way to make the selection from child boxes optional? For instance if I wanted to see New York but all cities in New York. Or if I wanted to see California > Los Angeles but all zip codes within. I can hard-code the option for all into the boxes but it gets filtered out when I select something in the parent box.
    Thanks!
  90. Wyldtwyst
    Oh wow I think I've got it working, I am not an ActionScript whiz but I played with it and got it to do what I want. (Users can select "ALL" in a child box now, but the child box is still filtered according to the selection in the parent). I did it by modifying multiSelectRel.cfm. Starting at line 78 this is what I have:
    <cfoutput>   
             var child = #thistag.selects[i+1].name#;
             var parent = #thistag.selects[i].name#;
             var parentColName = "parent#i+1#";
             var valueCol = "value#i+1#";
             var displayCol = "display#i+1#";
                                           
             child.removeAll();
             child.addItem("ALL","ALL");
             for(var i = 0; i < #attributes.id#_data.length; i++)
             {
             var item = #attributes.id#_data.getItemAt(i);
                if((item[parentColName] == parent.value or parent.value=="ALL") and item[displayCol] != null and item[valueCol] != null)
                {
                   child.addItem(item[displayCol],item[valueCol]);
                }
             }
             child.enabled = (child.length >1) ? true:false;
              child.dispatchEvent({type:'change'});
    </cfoutput>


    Thanks!!!!
  91. Maggie
    Is it possible to bind the values of the selects using the cf_multiSelectRelControl to a datagrid? I have the binding working fine, using the code from Mike Nimer's blog with regard to binding a select to a cfgrid, but when I try to put the onChange code into the multiSelectRel.cfm in the onChange event, nothing happens.

    I've tried a number of things, but I'm at the point where I think I'm doing more harm than good. Has anyone actually gotten binding the multi select to a cfgrid to work? If so, can you please help? Thanks in advance!!
  92. tim
    Maggie
    Did you ever get the multiselect to change the grid results?
    Mike Nimer's blog appears to let the grid change the multiselect (and not vice versa).
    I think the onchange of the multi's already call "actionPopulate".
    Thanks
    Tim
  93. tim
    Maggie
    Did you ever get the multiselect to change the grid results?
    Mike Nimer's blog appears to let the grid change the multiselect (and not vice versa).
    I think the onchange of the multi's already call "actionPopulate".
    Thanks
    Tim
  94. Aidan Guy

    Aidan Guy

    Could someone help explain how to link this to a database??
    I have been working on trying to achieve this for sme time and am struggling to make sense of it.
    I wouldn't normally just ask for a soloution but i don't have much time to get it working
    Thanks
    Aidan
  95. Paul Ihrig

    Paul Ihrig

    how would i reset the cf_multiSelectRelControl
    i tried a cfinput set to rest.
    but iit sets the value to previous state.
    not the default state...
  96. Paul Ihrig

    Paul Ihrig

    how would i reset the cf_multiSelectRelControl
    i tried a cfinput set to rest.
    but iit sets the value to previous state.
    not the default state...
  97. tony
    is there a way to use this in fusebox? i'm having problems using it in this framework
  98. Saiful

    Saiful

    Hi all

    I've used this tag in my application and it works great

    But there's one problem left, i've set the custom tag's attributes for required="yes" and message="Please select parameter" but when the error window displays, the message get wrap at the third character becoming

    Ple
    ase
    Sel
    ect
    Par
    ame
    ter

    Any help on this? Thanks
  99. Saiful

    Saiful

    Hi all,

    I managed to solve it, turns out i didn't set the width attribute for the tag... duh!

    Came out fine later
  100. frank
    Can somebody please tell me what modifications need to be made in order to use this without using flash? If you just take out the "format=flash" parameter, then the city & state fields are disabled by default.
  101. Susan
    Has anyone had an issue with data truncation using this? The query has all the data, but select does not. The query contains 1488 rows.. am I running into a Flash limit or something? I wanted to use this control to allow a user to choose a state, city and then zip code; for a given city, multiple zip codes are possible. Spent almost 2 days on this, now if I can't get all the zip codes to show it's a waste.
  102. Ron
    I have 3 related selects in a ColdFusion 9 Flash Form. The code works perfectly on our development server. When I run the same code on our production server, I get:

    Element SELECTS is undefined in THISTAG.

    Our Web Administrator says both servers are set up the same, but I suspect they are not.

    Has anyone encountered this? How did you get around this issue?

    Thanks in advance,

    Ron
  103. Ron
    The error I am getting

    Element SELECTS is undefined in THISTAG.

    is occurring in multiSelectRec.cfm where it references...

    cfset totalSelects = arraylen(thistag.selects)

    if I hardcode a value of 3 to say

    cfset totalSelects = 3

    then it gives the same error on the line that says

    cfset thisSelect = thistag.selects[i]

    The programs work on our development server, but not on our production server. Looked at the CFAdmin, and don't see any differences that stand out. Is there some sort of IIS setting that would affect this?

    Thanks,

    Ron
  104. Jay Mortiere

    Jay Mortiere

    Thank you for your help on this! Great code :)