[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

cfselects bind with multiple="yes"

Asked by panosms in ColdFusion Application Server, Cold Fusion Markup Language, Miscellaneous Programming, Programming, Programming Languages

Tags: CF8

Hello experts.
I have a code with two related selects using the bind function
The problem i have is to get the selected values after the form is submitted when i have selected more than one value by multiple="yes"
The code i have is working but only with one value.
Any help?
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:
<cfparam name="FORM.Main_ID" default="">
<cfparam name="Form.Sub_first_ID" default="">
<script type="text/javascript">
var imdone7 = false;
var imdone8 = false;
function Select7Default(x,val) {
 if(!imdone7) {
  var dd7 = document.getElementById('Main_ID');
  for(var i = 0; i < dd7.length; i++){
   if(dd7.options[i].value == val){
    dd7.selectedIndex = i;
   }
  }
  imdone7 = true;
 }
}
 
function Select8Default(x,val) {
 if(!imdone8) {
  var dd8 = document.getElementById('Sub_first_ID');
  for(var i = 0; i < dd8.length; i++){
 
   if(dd8.options[i].value.match(val) ){
    dd8.selectedIndex = i;
   }
  }
  imdone8 = true;
 }
}
</script>
<cfajaxproxy bind="javascript:Select7Default({Main_ID},#Form.Main_ID#)">
<cfajaxproxy bind="javascript:Select8Default({Sub_first_ID},#Form.Sub_first_ID#)">
 
<cfselect name="Main_ID"
            id="Main_ID"
            bind="cfc:test.com.ersatz6.getMain()"
            bindonload="true"
            value="ErsatzMain_Id"
            display="ErsatzMain_Text" 
            multiple="yes"
            style="height:100px"/>
<cfselect name="Sub_first_ID"
            id="Sub_first_ID"
            bind="cfc:test.com.ersatz6.getSub1({Main_ID})"
            value="Ersatz1Sub_ID"
            display="Ersatz1Sub_text"
            multiple="yes"
            style="height:100px"/>
<cfcomponent output="false">
   <cfset vlangid = #cookie.Lang#>
   <!--- Get array of media types --->
   <cffunction name="getMain" access="remote" returnType="array">
      <!--- Define variables --->
      <cfset var data="">
      <cfset var result=ArrayNew(2)>
      <cfset var i=0>
      
      <!--- Get data --->
     <cfquery name="data" datasource="#request.dsn#">
       SELECT ErsatzMain_Id,ErsatzMain_Text
       FROM dbo.ErsatzMain
       WHERE ErsatzMain_Id Between <cfqueryparam cfsqltype="cf_sql_integer" value="5"> 
                           AND <cfqueryparam cfsqltype="cf_sql_integer" value="35">                       
       ORDER BY ErsatzMain_Nr ASC 
     </cfquery>
     <!--- Convert results to array --->
     <cfloop index="i" from="1" to="#data.RecordCount#">
         <cfset result[i][1]=data.ErsatzMain_Id[i]>
         <cfset result[i][2]=data.ErsatzMain_Text[i]>
      </cfloop>
 <cffunction name="getSub1" access="remote" returnType="array">
      <cfargument name="ErsatzMain_Id" type="any" required="true">
 
      <!--- Define variables --->
      <cfset var data="">
      <cfset var result=ArrayNew(2)>
      <cfset var i=0>
      
     <cfif ARGUMENTS.ErsatzMain_Id NEQ "">
      <cfquery name="data" datasource="#request.dsn#">
      SELECT Ersatz1Sub_ID, Ersatz1Sub_Text
      FROM Ersatzsub1
      WHERE ErsatzMain_Id IN (<cfqueryparam cfsqltype="cf_sql_varchar" value="#ARGUMENTS.ErsatzMain_Id#" list="yes">)
            AND Ersatz1Sub_ID BETWEEN <cfqueryparam cfsqltype="cf_sql_integer" value="5"> 
                                  AND <cfqueryparam cfsqltype="cf_sql_integer" value="390">
                    
      ORDER BY Ersatz1Sub_NR
      </cfquery>
      
       
      <!--- Convert results to array --->
      <cfloop index="i" from="1" to="#data.RecordCount#">
         <cfset result[i][1]=data.Ersatz1Sub_ID[i]>
         <cfset result[i][2]=data.Ersatz1Sub_Text[i]>
      </cfloop>
      </cfif>
      <!--- And return it --->
      <cfreturn result>
   </cffunction>
 
</cfcomponent>
 
Loading Advertisement...
 
[+][-]07/23/09 03:58 PM, ID: 24930875Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07/23/09 03:58 PM, ID: 24930877Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]07/24/09 08:35 AM, ID: 24935967Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: ColdFusion Application Server, Cold Fusion Markup Language, Miscellaneous Programming, Programming, Programming Languages
Tags: CF8
Sign Up Now!
Solution Provided By: pravinasar
Participating Experts: 1
Solution Grade: A
 
[+][-]07/24/09 09:16 AM, ID: 24936442Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/24/09 09:39 AM, ID: 24936651Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/24/09 11:19 AM, ID: 24937526Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/24/09 11:43 AM, ID: 24937781Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/24/09 11:58 AM, ID: 24937969Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/24/09 12:43 PM, ID: 24938391Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/24/09 07:49 PM, ID: 24940522Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/25/09 08:17 AM, ID: 24941925Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/27/09 09:22 AM, ID: 24953182Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/27/09 11:41 AM, ID: 24954557Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20090701_SELECT_ZONES