Solved

Showing Data related to others

Posted on 2004-04-14
41
177 Views
Last Modified: 2013-12-24
Hi experts,
What i am trying to do, I have table it has customer name, Platform name, program name and program Engineer,
So in my table I have dropdown menu it shows all the customer, and what i want to do it depends on the choice i want to narrow the list
so if they choose my company i want to show in the other fields only the ones for my company,
Can you help please.
0
Comment
Question by:asamuel
  • 23
  • 12
  • 5
  • +1
41 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 10824959
Try looking at the two related selects tag that is free at Macromedia Extentions Exchange and download the free cold fusion tag called TwoSelectsRelated which will do a lot of the work for you: (Note I shortened the URLs, but they are from the official Macromeida site)

2 Related Selects:
http://tinyurl.com/2fa2k

3 Related Selects :
http://tinyurl.com/ys839
0
 
LVL 17

Expert Comment

by:anandkp
ID: 10826291
take a look at : Q_20575674.html
0
 

Author Comment

by:asamuel
ID: 10826768
I have only one table is this will be fine
0
 
LVL 18

Expert Comment

by:Plucka
ID: 10828862
There's two ways of doing this.

1. When you change the drop down, you post back to the same page which makes the next drop down populate

or

2. You have all the values stored in the page and select them through javascript.

It really depends on how many records we are talking about, if it's a lot then option 1 is best, I can post simple examples if needed.
0
 

Author Comment

by:asamuel
ID: 10829317
What i have here all the information in one table, but say customer name may have different platform for this customer, and different programso when i click on customer i should get the platform belong to this customer and the program too
0
 
LVL 18

Expert Comment

by:Plucka
ID: 10829389
ok,

So you can do an onchange event to your drop down which reloads the page passing the customer id.

Then have a query to read the bits

<cfquery name="whatever">
    select *
    from programs
    where customer = '#url.customer#'
</cfquery>

Then redisplay the table with the new queries.
0
 

Author Comment

by:asamuel
ID: 10829491
When I use URL.customerID, I omnly get just one record,\

What I did
<cfquery name="custinfo">
select *
from CustomerInfo
where custID=#url.custID#
this give me one customer,
what i need get all the customers, and depend on the customer i choose, i get the platform and program related to this customer
0
 

Author Comment

by:asamuel
ID: 10829492
When I use URL.customerID, I omnly get just one record,\

What I did
<cfquery name="custinfo">
select *
from CustomerInfo
where custID=#url.custID#
this give me one customer,
what i need get all the customers, and depend on the customer i choose, i get the platform and program related to this customer
0
 
LVL 18

Expert Comment

by:Plucka
ID: 10829532
Yes,

well the first time you go into the page, they need to pick a customer so url.customerID will not be defined.

<cfquery name="custinfo">
        select *
        from CustomerInfo
        <cfif IsDefined("Url.custId")>
                where custID=#url.custID#
        </cfif>
</cfquery>

Your select showing customers will look something like this.

<select name="custID" size="1" onChange="window.location.href = 'pagename.cfm?custId=this.options[custID.selectedIndex].value)">
0
 

Author Comment

by:asamuel
ID: 10832398
I just to be on the same page,
All these information on one page, like customer, platform, program all on the same page
0
 

Author Comment

by:asamuel
ID: 10833805
Hi Plucka,
Your code still give me only one customer the first one in the list, any ideas
0
 
LVL 18

Expert Comment

by:Plucka
ID: 10837626
What is the value of Url.custId when the page is first loaded?

If you have a <cfset or <cfparam on this variable before the query, you will need to change the query to

<cfquery name="custinfo">
        select *
        from CustomerInfo
        <cfif Url.custID neq "">
                where custID=#url.custID#
        </cfif>
</cfquery>
0
 

Author Comment

by:asamuel
ID: 10844066
I tried it but still give me all the data doesn't relate data to other
0
 

Author Comment

by:asamuel
ID: 10844130
mrichmon,
I am trying to use this 3 selects related, but I am getting error, did you use it before,
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10844354
I have used the 2 related selects, but not the 3.  But I know people who have.  What is the error you are getting?
0
 

Author Comment

by:asamuel
ID: 10844853
I am getting element is undefined,
here is what i did

<CFPARAM NAME="Attributes.Type1" DEFAULT="Select">  
<CFPARAM NAME="Attributes.HTMLAfterEachRadio1" DEFAULT="">  
<CFPARAM NAME="Attributes.name1" DEFAULT="">
<CFPARAM NAME="Attributes.name2" DEFAULT="">
<CFPARAM NAME="Attributes.name3" DEFAULT="">
<CFPARAM NAME="Attributes.customer" default="1">
<CFPARAM NAME="Attributes.platform" default="1">
<CFPARAM NAME="Attributes.program" default="1">
<CFPARAM NAME="Attributes.Display1" DEFAULT="#Attributes.custID#">
<CFPARAM NAME="Attributes.Display2" DEFAULT="#Attributes.custID#">
<CFPARAM NAME="Attributes.Display2" DEFAULT="#Attributes.custID#">
<CFPARAM NAME="Attributes.Default1" DEFAULT="xxxxxxxxxxxx">
<CFPARAM NAME="Attributes.Default2" DEFAULT="xxxxxxxxxxxx">
<CFPARAM NAME="Attributes.Default3" DEFAULT="xxxxxxxxxxxx">
<CFPARAM NAME="Attributes.Multiple3" DEFAULT="No">
<CFPARAM NAME="Attributes.Size1" DEFAULT="1">
<CFPARAM NAME="Attributes.Size2" DEFAULT="1">
<CFPARAM NAME="Attributes.Size3" DEFAULT="1">
<CFPARAM NAME="Attributes.ExtraOptions2" DEFAULT="">
<CFPARAM NAME="Attributes.ExtraOptions3" DEFAULT="">
<CFPARAM NAME="Attributes.Width1" DEFAULT="150">
<CFPARAM NAME="Attributes.Width2" DEFAULT="150">
<CFPARAM NAME="Attributes.Width3" DEFAULT="150">
<CFPARAM NAME="Attributes.ForceWidth1" DEFAULT="">
<CFPARAM NAME="Attributes.ForceWidth2" DEFAULT="">
<CFPARAM NAME="Attributes.ForceWidth4" DEFAULT="">
<CFPARAM NAME="Attributes.ForceWidthChar" DEFAULT="&nbsp;">
<CFPARAM NAME="Attributes.EmptyText1" DEFAULT="">
<CFPARAM NAME="Attributes.EmptyText2" DEFAULT="">
<CFPARAM NAME="Attributes.EmptyText3" DEFAULT="">
<CFPARAM NAME="Attributes.Message1" DEFAULT="You must choose an option for #Attributes.customer#.">
<CFPARAM NAME="Attributes.Message2" DEFAULT="You must choose an option for #Attributes.platform#.">
<CFPARAM NAME="Attributes.Message3" DEFAULT="You must choose an option for #Attributes.program#.">
<CFPARAM NAME="Attributes.FormName" DEFAULT="forms[0]">
<CFPARAM NAME="Attributes.HTMLAfter1" DEFAULT="">
<CFPARAM NAME="Attributes.HTMLAfter2" DEFAULT="">
<CFPARAM NAME="Attributes.OnChange" DEFAULT="">
<CFPARAM NAME="Attributes.AutoSelectFirst" DEFAULT="Yes">
<cfquery name="selected" datasource="testrequest">
SELECT * FROM dbo.customerInfo
</cfquery>
<CFIF Attributes.Type1 is "Radio">
  <CFSET Attributes.EmptyText1 = "">
  <CFSET Attributes.ForceWidth1 = "">
</CFIF>



<CFSET FunctionName = ReplaceList(Attributes.FormName, "[,]", ",") & "ChangeMenu">
<CFSET Functionplatform = ReplaceList(Attributes.FormName, "[,]", ",") & "ChangeMenu2">


<!--- "MAGIC" SHORTCUTS FOR THE ONCHANGE HANDLER --->
<CFIF Attributes.OnChange is "Jump!">
  <CFSET Attributes.OnChange = "document.location = this.options[selectedIndex].value;">
<CFELSEIF Attributes.OnChange is "Submit!">
  <CFSET Attributes.OnChange = "this.form.submit();">
</CFIF>



<!--- USE PASSED selected WITHIN THIS CODE AS "selected" --->
<CFSET selected = Evaluate("Caller.#Attributes.selected#")>


<!--- BEGIN JAVASCRIPTING --->
<CFOUTPUT>
      
  <SCRIPT LANGUAGE="JavaScript1.1">
        // javascript code generated by the CF_TwoSelectsRelated Cold Fusion tag (Nate Weiss, 4/98)
            // portions adapted from Nick Heinle's code at http://webreference.com/javascript/960902/select_boxes.html
        var maxlength = 10;
        OneA = new Array;

            var trueLength = OneA.length;  
            var lst = OneA.length;
    var Trak = 0;

    function require_#Attributes.customer#() {
              with (document.#Attributes.FormName#.#Attributes.customer#) {
                    RetVal = true;
                    if (Trak == -1) RetVal = false;
                          <CFIF Attributes.Type1 is "Select">
                          else RetVal = !(options[Trak].value == '');
                              <CFELSEIF Attributes.Type1 is "Radio">
                          else { if (document.#Attributes.FormName#.#Attributes.customer#[Trak].value == '') RetVal = false; else RetVal = true;}
                              </CFIF>
                    if (!RetVal) alert('#Attributes.Message1#');
                        return RetVal;
                  }
            }

    function require_#Attributes.platform#() {
              with (document.#Attributes.FormName#.#Attributes.platform#) {
                    RetVal = true;
                    if (selectedIndex == -1) RetVal = false;
                          else RetVal = !(options[selectedIndex].value == '');
                    if (!RetVal) alert('#Attributes.Message2#');
        return eval(RetVal);
                        return RetVal;
                  }
            }
            
    function require_#Attributes.program#() {
              with (document.#Attributes.FormName#.#Attributes.program#) {
                    RetVal = true;
                    if (selectedIndex == -1) RetVal = false;
                          else RetVal = !(options[selectedIndex].value == '');
                    if (!RetVal) alert('#Attributes.Message3#');
                        return RetVal
                  }
            }
            
            function require_#Attributes.customer#And#Attributes.platform#() {
              return ((require_#Attributes.customer#()) && (require_#Attributes.platform#()));
            }

            function require_#Attributes.platform#And#Attributes.program#() {
              return ((require_#Attributes.platform#()) && (require_#Attributes.program#()));
            }
            
            function require_#Attributes.customer#And#Attributes.platform#And#Attributes.program#() {
              return ((require_#Attributes.customer#And#Attributes.platform#()) && (require_#Attributes.program#()));
            }
                        
            function #FunctionName#(menuNum) {
               OneA.length = 0;
               if (menuNum == null) return;  
                   Trak = menuNum;
                   <!--- ignore if a blank item gets clicked --->
                   <CFIF Attributes.Type1 is "Select">
                   if (document.#Attributes.FormName#.#Attributes.customer#.options[menuNum].value == '') return;
                   if (document.#Attributes.FormName#.#Attributes.customer#.options[menuNum].value == null) return;
                   </CFIF>
</CFOUTPUT>


<!--- COUNTER VARIABLE WILL HOLD NUMBER OF GROUPS (OPTIONS IN FIRST SELECT) --->
<CFSET Counter = IIF(Attributes.EmptyText1 is not "", 1, 0)>

<!--- CREATE AN "IF" STATEMENT THAT COVERS EACH ITEM IN THE FIRST SELECT BOX --->
<!--- WITHIN THE "IF" STATMENT, PRE-POPULATE ARRAY WITH CORRESPONDING ITEMS FOR SECOND SELECT  --->
<CFOUTPUT query="selected" GROUP="#Attributes.Display1#">
      if (menuNum == #Counter#) {
        NewOpt = new Array;
            NewVal = new Array;
    <CFSET Counter2 = IIF(Attributes.EmptyText2 is not "", 1, 0)>
    <CFIF Attributes.EmptyText2 is not ""><CFOUTPUT>NewOpt[0] = new Option("#Attributes.EmptyText2#");      NewOpt[0].value = '';      </CFOUTPUT></CFIF>
            <CFOUTPUT GROUP="#Attributes.Display2#">NewOpt[#Counter2#] = new Option("#Evaluate(Attributes.Display2)#");      NewOpt[#Counter2#].value = '#Evaluate(Attributes.Value2)#'; <CFSET Counter2 = Counter2 + 1></CFOUTPUT>
      } <CFSET Counter = Counter + 1>
</CFOUTPUT>


<!--- finish up the ChangeMenu() function --->
<CFOUTPUT>
  tot = NewOpt.length;
      lst = document.#Attributes.FormName#.#Attributes.platform#.options.length;
      for (i = lst; i > 0; i--) {
        document.#Attributes.FormName#.#Attributes.platform#.options[i] = null;
      }
  for (i = 0; i < tot; i++) {
        document.#Attributes.FormName#.#Attributes.platform#.options[i] = NewOpt[i];
      }
  <!--- <CFIF Attributes.AutoSelectFirst is "Yes"> --->
        document.#Attributes.FormName#.#Attributes.platform#.options[0].selected = true;
      <!--- </CFIF> --->
      #Functionplatform#(0);
}
</CFOUTPUT>




<!--- ALLOW FOR AUTO-SIZING "SHORTCUT" OF SELECT BOXES --->
<CFIF Attributes.Size1 is "Auto">
  <!--- MAKE THE FIRST SELECT BE BIG ENOUGH FOR ALL OF ITS OPTIONS --->
  <CFSET Attributes.Size1 = Counter>
</CFIF>
<CFIF Attributes.Size2 is "Auto">
  <!--- MAKE THE SECOND SELECT BE THE SAME SIZE AS THE FIRST --->
  <CFSET Attributes.Size2 = Attributes.Size1>
</CFIF>
<CFIF Attributes.Size3 is "Auto">
  <!--- MAKE THE SECOND SELECT BE THE SAME SIZE AS THE FIRST --->
  <CFSET Attributes.Size3 = Attributes.Size1>
</CFIF>



<CFOUTPUT>
            function #Functionplatform#() {
               OneA.length = 0;
                   menuNum = Trak;
               //menuNum = document.#Attributes.FormName#.#Attributes.customer#.selectedIndex;
               menuNum2 = document.#Attributes.FormName#.#Attributes.platform#.selectedIndex;
               if (menuNum == -1) return;  
               if (menuNum2 == null) return;  
                   <!--- ignore if a the blank item gets clicked --->
                   if (document.#Attributes.FormName#.#Attributes.platform#.options[menuNum2].value == '') return;
</CFOUTPUT>


<!--- COUNTER VARIABLE WILL HOLD NUMBER OF GROUPS (OPTIONS IN FIRST SELECT) --->
<CFSET Counter1 = 0>

<!--- CREATE AN "IF" STATEMENT THAT COVERS EACH ITEM IN THE FIRST SELECT BOX --->
<!--- WITHIN THE "IF" STATMENT, PRE-POPULATE ARRAY WITH CORRESPONDING ITEMS FOR SECOND SELECT  --->
<CFOUTPUT query="selected" GROUP="#Attributes.Display1#">
if (menuNum == #Counter1#) {
<CFSET Counter = IIF(Attributes.EmptyText2 is not "", 1, 0)>
<CFOUTPUT GROUP="#Attributes.Display2#">
      if (menuNum2 == #Counter#) {
        NewOpt = new Array;
            NewVal = new Array;
    <CFSET Counter2 = IIF(Attributes.EmptyText2 is not "", 1, 0)>
    <CFIF Attributes.EmptyText3 is not "">NewOpt[0] = new Option("#Attributes.EmptyText3#");      NewOpt[0].value = '';      </CFIF>
            <CFOUTPUT>
              NewOpt[#Counter2#] = new Option("#Evaluate(Attributes.Display3)#");
                  NewOpt[#Counter2#].value = '#Evaluate(Attributes.Value3)#';
                  <CFSET Counter2 = Counter2 + 1>
            </CFOUTPUT>
      } <CFSET Counter = Counter + 1>
</CFOUTPUT>      
}      <CFSET Counter1 = Counter1 + 1>
</CFOUTPUT>


<CFOUTPUT>
  tot = NewOpt.length;
      lst = document.#Attributes.FormName#.#Attributes.program#.options.length;
      
      for (i = lst; i > 0; i--) {
        document.#Attributes.FormName#.#Attributes.program#.options[i] = null;
      }
  for (i = 0; i < tot; i++) {
        document.#Attributes.FormName#.#Attributes.program#.options[i] = NewOpt[i];
      }
  <CFIF Attributes.AutoSelectFirst is "Yes">
        document.#Attributes.FormName#.#Attributes.program#.options[0].selected = true;
      </CFIF>
}
</SCRIPT>
</CFOUTPUT>

<!--- DONE WITH JAVASCRIPTING.  NOW WE JUST HAVE TO DISPLAY THE FORM ELEMENTS --->







<!--- OUTPUT FIRST FORM ELEMENT --->
<CFIF Attributes.Type1 is "Select">
<CFOUTPUT><SELECT NAME="#Attributes.customer#" onChange="#FunctionName#(this.selectedIndex)" SIZE="#Attributes.Size1#" <CFIF Attributes.Width1 is not "">STYLE="width:#Attributes.Width1#"</CFIF>></CFOUTPUT>
      <!--- SPECIAL FIRST ITEM, IF REQUESTED --->
      <CFIF Attributes.EmptyText1 is not ""><CFOUTPUT><OPTION VALUE="">#Attributes.EmptyText1#</CFOUTPUT></CFIF>
      <!--- GENERATE REMAINING ITEMS FROM selected --->
      <CFOUTPUT query="selected" GROUP="#Attributes.Display1#"><OPTION VALUE="#Evaluate(Attributes.Value1)#"  <CFIF Evaluate(Attributes.Value1) is Attributes.Default1>SELECTED</CFIF>>#Evaluate(Attributes.Display1)#</CFOUTPUT>
      
  <!--- "FORCE WIDTH" OPTION AT BOTTOM, IF REQUESTED --->
      <CFIF Attributes.ForceWidth1 is not ""><CFOUTPUT><OPTION VALUE="">#RepeatString(Attributes.ForceWidthChar, Attributes.ForceWidth1)#</CFOUTPUT></CFIF>
<CFOUTPUT></SELECT></CFOUTPUT>

<CFELSE>
  <!--- RADIO BOXES --->
  <CFSET Counter = 0>
  <CFOUTPUT query="selected" GROUP="#Attributes.Display1#"><INPUT TYPE="Radio" NAME="#Attributes.customer#" VALUE="#Evaluate(Attributes.Value1)#" <CFIF Evaluate(Attributes.Value1) is Attributes.Default1>CHECKED</CFIF> onClick="#FunctionName#(#Counter#)">#Evaluate(Attributes.Display1)##Attributes.HTMLAfterEachRadio1#<CFSET Counter = Counter + 1></CFOUTPUT>

</CFIF>



<!--- INSERT ANY REQUESTED HTML BETWEEN 1ST AND SECOND ITEMS --->
<CFOUTPUT>#Attributes.HTMLAfter1#</CFOUTPUT>



<!--- OUTPUT SECOND SELECT BOX --->
<CFOUTPUT><SELECT NAME="#Attributes.platform#" SIZE="#Attributes.Size2#" onChange="#Functionplatform#(this.selectedIndex)" <CFIF Attributes.Width2 is not "">STYLE="width:#Attributes.Width2#"</CFIF>></CFOUTPUT>
      <!--- SPECIAL FIRST ITEM, IF REQUESTED --->
      <CFIF Attributes.EmptyText2 is not ""><CFOUTPUT><OPTION VALUE="">#Attributes.EmptyText2#</CFOUTPUT></CFIF>
      
      <!--- GENERATE REMAINING ITEMS FROM selected --->
      <!--- WE ONLY NEED TO OUTPUT THE CHOICES FOR THE FIRST GROUP --->
      <!--- <CFSET FirstGroup = Evaluate("selected.#Attributes.Value1#[1]")> --->
      <CFSET FirstGroup = Attributes.Default1>
      <CFSET CurrentGroup2 = "">
      <CFIF Attributes.EmptyText1 is "">
            <CFLOOP query="selected">
              <CFIF Evaluate("selected.#Attributes.Value1#") is Variables.FirstGroup>
                    <CFSET ThisValue = Evaluate("selected.#Attributes.Value2#")>
                    <CFIF Variables.ThisValue is not Variables.CurrentGroup2>
                      <CFOUTPUT><OPTION VALUE="#Variables.ThisValue#" <CFIF Variables.ThisValue is Attributes.Default2>SELECTED</CFIF>>#Evaluate("selected.#Attributes.Display2#")#</CFOUTPUT>
                        <CFSET CurrentGroup2 = Evaluate("selected.#Attributes.Value2#")>
                        </CFIF>
                  <!--- <CFELSE>
                    <CFBREAK> --->
                  </CFIF>
            </CFLOOP>
      </CFIF>      

  <!--- "FORCE WIDTH" OPTION AT BOTTOM, IF REQUESTED --->
      <CFIF Attributes.ForceWidth2 is not ""><CFOUTPUT><OPTION VALUE="">#RepeatString(Attributes.ForceWidthChar, Attributes.ForceWidth2)#</CFOUTPUT></CFIF>
      <CFIF Attributes.ExtraOptions2 is not ""><CFLOOP INDEX="This" FROM="1" TO="#Attributes.ExtraOptions2#"><CFOUTPUT><OPTION VALUE=""></CFOUTPUT></CFLOOP></CFIF>
<CFOUTPUT></SELECT></CFOUTPUT>



<!--- INSERT ANY REQUESTED HTML BETWEEN 2ND AND 3RD ITEMS --->
<CFOUTPUT>#Attributes.HTMLAfter2#</CFOUTPUT>



<!--- OUTPUT THIRD SELECT BOX --->
<CFOUTPUT><SELECT NAME="#Attributes.program#" SIZE="#Attributes.Size3#" <CFIF Attributes.Multiple3 is "Yes">MULTIPLE </CFIF><CFIF Attributes.Width3 is not "">STYLE="width:#Attributes.Width3#"</CFIF><CFIF Attributes.OnChange is not ""> OnChange="#Attributes.OnChange#"</CFIF>></CFOUTPUT>
      <CFSET FirstGroup = Attributes.Default1>
      <CFIF Attributes.EmptyText3 is "">
            <CFLOOP query="selected">
              <CFIF Evaluate("selected.#Attributes.Value1#") is Variables.FirstGroup>
                    <CFSET Hack = Evaluate("selected.#Attributes.Value2#")>
                    <CFSET ThisValue = Evaluate("selected.#Attributes.Value3#")>
                    <CFPARAM NAME="Variables.FirstGroup2" DEFAULT="#Variables.Hack#">
                    <CFIF Evaluate("selected.#Attributes.Value2#") is Variables.FirstGroup2>
                          <CFOUTPUT><OPTION VALUE="#Variables.ThisValue#" <CFIF Variables.ThisValue is Attributes.Default3>SELECTED</CFIF>>#Evaluate("selected.#Attributes.Display3#")#</CFOUTPUT>
                        </CFIF>      
                  </CFIF>
            </CFLOOP>
      </CFIF>      

      <CFIF Attributes.ForceWidth3 is not ""><CFOUTPUT><OPTION VALUE="">#RepeatString(Attributes.ForceWidthChar, Attributes.ForceWidth3)#</CFOUTPUT></CFIF>
      <CFIF Attributes.ExtraOptions3 is not ""><CFLOOP INDEX="This" FROM="1" TO="#Attributes.ExtraOptions3#"><CFOUTPUT><OPTION VALUE=""></CFOUTPUT></CFLOOP></CFIF>
<CFOUTPUT></SELECT></CFOUTPUT>

<!--- REMOVE THIS AND FIRST LINE IF NOT USING CF3.1 OR LATER --->
<CFSETTING ENABLECFOUTPUTONLY="NO">
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10845867
Can you copy and past the exact error message - including line number that is returned by Cold Fusion?
0
 

Author Comment

by:asamuel
ID: 10863037
Here is what i got, I posted this earlier but don't know what happened

Error Occurred While Processing Request  
Element CUSTID is undefined in ATTRIBUTES.  
 
 
The error occurred in C:\Inetpub\wwwroot\ATCTESTnet\test\calendar\ThreeSelectsRelated.cfm: line 10
 
8 : <CFPARAM NAME="Attributes.platform" default="1">
9 : <CFPARAM NAME="Attributes.program" default="1">
10 : <CFPARAM NAME="Attributes.Display1" DEFAULT="#Attributes.custID#">
11 : <CFPARAM NAME="Attributes.Display2" DEFAULT="#Attributes.custID#">
12 : <CFPARAM NAME="Attributes.Display2" DEFAULT="#Attributes.custID#">

 

--------------------------------------------------------------------------------
 
Please try the following:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.

 
Browser   Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
Remote Address   10.95.44.199
Referrer    
Date/Time   19-Apr-04 04:08 PM
 
Stack Trace (click to expand)  
at cfThreeSelectsRelated2ecfm735903994._factor3(C:\Inetpub\wwwroot\ATCTESTnet\test\calendar\ThreeSelectsRelated.cfm:10) at cfThreeSelectsRelated2ecfm735903994.runPage(C:\Inetpub\wwwroot\ATCTESTnet\test\calendar\ThreeSelectsRelated.cfm:1)


coldfusion.runtime.UndefinedElementException: Element CUSTID is undefined in ATTRIBUTES.
      at coldfusion.runtime.DotResolver.resolveSplitNameInMap(DotResolver.java:98)
      at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:999)
      at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1111)
      at cfThreeSelectsRelated2ecfm735903994._factor3(C:\Inetpub\wwwroot\ATCTESTnet\test\calendar\ThreeSelectsRelated.cfm:10)
      at cfThreeSelectsRelated2ecfm735903994.runPage(C:\Inetpub\wwwroot\ATCTESTnet\test\calendar\ThreeSelectsRelated.cfm:1)
      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:147)
      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:357)
      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:62)
      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:107)
      at coldfusion.filter.PathFilter.invoke(PathFilter.java:80)
      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:47)
      at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:35)
      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:43)
      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
      at coldfusion.CfmServlet.service(CfmServlet.java:105)
      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:192)
      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

 
 
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10863317
okay that indicates that you are not calling hte 3 related tags with the custid as an attribute.

CAn you post the code from the page that calls the 3 related selects tag?
0
 

Author Comment

by:asamuel
ID: 10864552
What do you mean by this
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 35

Expert Comment

by:mrichmon
ID: 10864588
The code you posted is the code that runs when you call the ThreeRelatedSelects tag.

But there should be one line of code like

<CF_ThreeRelatedSelects ...>

Can you post that code?
0
 

Author Comment

by:asamuel
ID: 10867819
The code i downloaded doesn't have this tag
0
 

Author Comment

by:asamuel
ID: 10868699
mrichmon,
if you can help me i will really appreciate it,
Thanks,
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10870168
That is the code used to call the tag.

What happens is that you have the tag stored in your CustomTags folder.

Then on the page that you want to display the 3 related select boxes you will have a line of code similar to that one that will call the tag.

WHen you go to the link on Macromedia's site that I gave to download the tag if you scroll down there is a link called "Usage Syntax"

This link shows you how to call this tag.
0
 

Author Comment

by:asamuel
ID: 10870433
mrichmon,
Thank you for getting back, I saw this usage syntax earlier this morning and i didn't know how to use it,
so now you said the file i downloaded this will be stored in custom folder, and the code in the usage syntax will be on the display page,
I hope you can bear with me and excuse my ignorance, so do i need to change any thing in this file, or use it as it is, and this custom folder will be on the server, could you please show this in details, i am really appreciate your help
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10870544
Maybe I should explain custom tags really quick.  that may help...

A custom tag is just another cold fusion file that you make a call to.  You can think of it like a function.

So If I have a page that looks like this :

CheckZipcode.cfm
<cfparam name="Attributes.Zipcode" type="numeric">
<cfparam name="ATTRIBUTES.ReturnVariable" type="variablename">
<cfif REFind("^\d{5}(-\d{4})?$", Attributes.Zipcode) EQ 0>
  <cfset badzipcode = true>
<cfelse>
  <cfset badzipcode = false>
</cfif>

<cfset "Caller.#ATTRIBUTES.ReturnVariable#" = badzipcode>


Then in the page I want to use it the code would look like this :

<!--- This calls the tag and runs it --->
<CF_CheckZipcode Zipcode="#Form.Zipcode#" ReturnVariable="BadZip">

Then later in the page I can use <cfif BadZip>Write an error</cfif>


SO there are 2 parts to custom tags.

1)The tag code - that is what you downloaded and really it shouldn't need to be modified much
2) The line to call the tag where you send in all of the required fields - this is what the Usage Syntax is an example of.

Does that help?
0
 

Author Comment

by:asamuel
ID: 10870724
mrichmon,
I did what you said and i got this error

Error Occurred While Processing Request  
Variable Caller.customerinfo is undefined.  
 
 
The error occurred in C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 67
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 1
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\members_only.cfm: line 1
 
65 :
66 : <!--- USE PASSED QUERY WITHIN THIS CODE AS "MyQuery" --->
67 : <CFSET customerinfo = Evaluate("Caller.#Attributes.query#")>
68 :
69 :

 

--------------------------------------------------------------------------------
 
Please try the following:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.

 
Browser   Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)
Remote Address   10.95.44.199
Referrer   http://testdata1/atctestnet/Test_request/login.cfm
Date/Time   20-Apr-04 01:24 PM
 
Stack Trace (click to expand)  
at cfThreeSelectsRelated2ecfm160537364._factor3(C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm:67) at cfThreeSelectsRelated2ecfm160537364.runPage(C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm:1) at cfmembers_only2ecfm1737688851.runPage(C:\Inetpub\wwwroot\ATCTESTnet\Test_request\members_only.cfm:1)


coldfusion.runtime.UndefinedVariableException: Variable Caller.customerinfo is undefined.
      at coldfusion.runtime.CfJspPage._get(CfJspPage.java:177)
      at coldfusion.runtime.CfJspPage._autoscalarize(CfJspPage.java:927)
      at coldfusion.compiler.ExprClassLoader.evaluate(ExprClassLoader.java:130)
      at coldfusion.runtime.CFPage.Evaluate(CFPage.java:2320)
      at cfThreeSelectsRelated2ecfm160537364._factor3(C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm:67)
      at cfThreeSelectsRelated2ecfm160537364.runPage(C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm:1)
      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:147)
      at coldfusion.filter.CFVariablesScopeFilter.invoke(CFVariablesScopeFilter.java:60)
      at coldfusion.tagext.lang.ModuleTag.doStartTag(ModuleTag.java:256)
      at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:1881)
      at cfmembers_only2ecfm1737688851.runPage(C:\Inetpub\wwwroot\ATCTESTnet\Test_request\members_only.cfm:1)
      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:147)
      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:357)
      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:62)
      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:107)
      at coldfusion.filter.PathFilter.invoke(PathFilter.java:80)
      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:47)
      at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:35)
      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:43)
      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
      at coldfusion.CfmServlet.service(CfmServlet.java:105)
      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:192)
      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)

 
 
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10871111
I am not sure what you did that I said - I only gave a breif example of a tag that would check a zip code - not anything related to this tag.

This tag should come usable.

In fact when you download the zip it includes an example file called CF_ThreeSelectsRelated.html that shows usage and how it might work in your form.  I think you should read this document to see how to use the tag since my explaining isn't helping.
0
 

Author Comment

by:asamuel
ID: 10871144
I did not used the zipcode example, i used the ThreeSelectsRelated, with the usage syntax, and i am getting this error

sorry the confusion

Attribute validation error for tag cfoutput.  
The value of the attribute query, which is currently "customerinfo", is invalid.  
 
The error occurred in C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 152
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 1
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\members_only.cfm: line 1
 
150 : <!--- CREATE AN "IF" STATEMENT THAT COVERS EACH ITEM IN THE FIRST SELECT BOX --->
151 : <!--- WITHIN THE "IF" STATMENT, PRE-POPULATE ARRAY WITH CORRESPONDING ITEMS FOR SECOND SELECT  --->
152 : <CFOUTPUT QUERY="customerinfo" GROUP="#Attributes.Display1#">
153 :       if (menuNum == #Counter#) {
154 :         NewOpt = new Array;

 
0
 

Author Comment

by:asamuel
ID: 10871836
mrichmon,
I think I am almost there, I used the file i downloaded from macromedia,
i changed the query name and the form name to match the display page, and i modified the usage syntax to match my
my fields name, but i am still getting there error if you can help will really appreciate it

Attribute validation error for tag cfoutput.  
The value of the attribute query, which is currently "customerinfo", is invalid.  
 
The error occurred in C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 152
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 1
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\members_only.cfm: line 1
 
150 : <!--- CREATE AN "IF" STATEMENT THAT COVERS EACH ITEM IN THE FIRST SELECT BOX --->
151 : <!--- WITHIN THE "IF" STATMENT, PRE-POPULATE ARRAY WITH CORRESPONDING ITEMS FOR SECOND SELECT  --->
152 : <CFOUTPUT QUERY="customerinfo" GROUP="#Attributes.Display1#">
153 :      if (menuNum == #Counter#) {
154 :        NewOpt = new Array;
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10872533
Is the query named customerinfo?  If not then you need to match to what you named the query
0
 

Author Comment

by:asamuel
ID: 10873433
the query name is customerinfo
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10873464
Well the error is saying that the query is not defined in the scope.  A basic explaniation is that it is not on the page where it is being used.  DO you have the query defined on that page?
0
 

Author Comment

by:asamuel
ID: 10877074
I did defined the query name, I know it is long code, but may be if i post it will save you and me some time,

<cfquery name="customerinfo" datasource="testrequest">
SELECT * FROM dbo.customerInfo
</cfquery>
<!--- <!--- REMOVE THIS AND FIRST LINE IF NOT USING CF3.1 OR LATER --->
<CFSETTING ENABLECFOUTPUTONLY="YES">
 --->
<!--- TAG PARAMETERS --->
<CFPARAM NAME="Attributes.Query">  
<CFPARAM NAME="Attributes.Type1" DEFAULT="Select">  
<CFPARAM NAME="Attributes.HTMLAfterEachRadio1" DEFAULT="">  
<CFPARAM NAME="Attributes.Name1" DEFAULT="TwoSelectsRelated1">
<CFPARAM NAME="Attributes.Name2" DEFAULT="TwoSelectsRelated2">
<CFPARAM NAME="Attributes.Name3" DEFAULT="TwoSelectsRelated3">
<CFPARAM NAME="Attributes.Value1">
<CFPARAM NAME="Attributes.Value2">
<CFPARAM NAME="Attributes.Value3">
<CFPARAM NAME="Attributes.Display1" DEFAULT="#Attributes.Value1#">
<CFPARAM NAME="Attributes.Display2" DEFAULT="#Attributes.Value2#">
<CFPARAM NAME="Attributes.Display2" DEFAULT="#Attributes.Value3#">
<CFPARAM NAME="Attributes.Default1" DEFAULT="xxxxxxxxxxxx">
<CFPARAM NAME="Attributes.Default2" DEFAULT="xxxxxxxxxxxx">
<CFPARAM NAME="Attributes.Default3" DEFAULT="xxxxxxxxxxxx">
<CFPARAM NAME="Attributes.Multiple3" DEFAULT="No">
<CFPARAM NAME="Attributes.Size1" DEFAULT="1">
<CFPARAM NAME="Attributes.Size2" DEFAULT="1">
<CFPARAM NAME="Attributes.Size3" DEFAULT="1">
<CFPARAM NAME="Attributes.ExtraOptions2" DEFAULT="">
<CFPARAM NAME="Attributes.ExtraOptions3" DEFAULT="">
<CFPARAM NAME="Attributes.Width1" DEFAULT="">
<CFPARAM NAME="Attributes.Width2" DEFAULT="">
<CFPARAM NAME="Attributes.Width3" DEFAULT="">
<CFPARAM NAME="Attributes.ForceWidth1" DEFAULT="">
<CFPARAM NAME="Attributes.ForceWidth2" DEFAULT="">
<CFPARAM NAME="Attributes.ForceWidth4" DEFAULT="">
<CFPARAM NAME="Attributes.ForceWidthChar" DEFAULT="&nbsp;">
<CFPARAM NAME="Attributes.EmptyText1" DEFAULT="">
<CFPARAM NAME="Attributes.EmptyText2" DEFAULT="">
<CFPARAM NAME="Attributes.EmptyText3" DEFAULT="">
<CFPARAM NAME="Attributes.Message1" DEFAULT="You must choose an option for #Attributes.Name1#.">
<CFPARAM NAME="Attributes.Message2" DEFAULT="You must choose an option for #Attributes.Name2#.">
<CFPARAM NAME="Attributes.Message3" DEFAULT="You must choose an option for #Attributes.Name3#.">
<CFPARAM NAME="Attributes.FormName" DEFAULT="members">
<CFPARAM NAME="Attributes.HTMLAfter1" DEFAULT="">
<CFPARAM NAME="Attributes.HTMLAfter2" DEFAULT="">
<CFPARAM NAME="Attributes.OnChange" DEFAULT="">
<CFPARAM NAME="Attributes.AutoSelectFirst" DEFAULT="Yes">


<CFIF Attributes.Type1 is "Radio">
 
 
  <CFSET Attributes.EmptyText1 = "">
  <CFSET Attributes.ForceWidth1 = "">
</CFIF>



<CFSET FunctionName = ReplaceList(Attributes.FormName, "[,]", ",") & "ChangeMenu">
<CFSET FunctionName2 = ReplaceList(Attributes.FormName, "[,]", ",") & "ChangeMenu2">


<!--- "MAGIC" SHORTCUTS FOR THE ONCHANGE HANDLER --->
<CFIF Attributes.OnChange is "Jump!">
 
 
  <CFSET Attributes.OnChange = "document.location = this.options[selectedIndex].value;">
<CFELSEIF Attributes.OnChange is "Submit!">
  <CFSET Attributes.OnChange = "this.form.submit();">
</CFIF>



<!--- USE PASSED QUERY WITHIN THIS CODE AS "customerinfo" --->
<CFSET "customerinfo" ="Caller.#Attributes.query#">


<!--- BEGIN JAVASCRIPTING --->
<CFOUTPUT>
      
  <SCRIPT LANGUAGE="JavaScript1.1">
        // javascript code generated by the CF_TwoSelectsRelated Cold Fusion tag (Nate Weiss, 4/98)
            // portions adapted from Nick Heinle's code at http://webreference.com/javascript/960902/select_boxes.html
        var maxlength = 10;
        OneA = new Array;

            var trueLength = OneA.length;  
            var lst = OneA.length;
    var Trak = 0;

    function require_#Attributes.Name1#() {
              with (document.#Attributes.FormName#.#Attributes.Name1#) {
                    RetVal = true;
                    if (Trak == -1) RetVal = false;
                          <CFIF Attributes.Type1 is "Select">
                          else RetVal = !(options[Trak].value == '');
                              <CFELSEIF Attributes.Type1 is "Radio">
                          else { if (document.#Attributes.FormName#.#Attributes.Name1#[Trak].value == '') RetVal = false; else RetVal = true;}
                              </CFIF>
                    if (!RetVal) alert('#Attributes.Message1#');
                        return RetVal;
                  }
            }

    function require_#Attributes.Name2#() {
              with (document.#Attributes.FormName#.#Attributes.Name2#) {
                    RetVal = true;
                    if (selectedIndex == -1) RetVal = false;
                          else RetVal = !(options[selectedIndex].value == '');
                    if (!RetVal) alert('#Attributes.Message2#');
        return eval(RetVal);
                        return RetVal;
                  }
            }
            
    function require_#Attributes.Name3#() {
              with (document.#Attributes.FormName#.#Attributes.Name3#) {
                    RetVal = true;
                    if (selectedIndex == -1) RetVal = false;
                          else RetVal = !(options[selectedIndex].value == '');
                    if (!RetVal) alert('#Attributes.Message3#');
                        return RetVal
                  }
            }
            
            function require_#Attributes.Name1#And#Attributes.Name2#() {
              return ((require_#Attributes.Name1#()) && (require_#Attributes.Name2#()));
            }

            function require_#Attributes.Name2#And#Attributes.Name3#() {
              return ((require_#Attributes.Name2#()) && (require_#Attributes.Name3#()));
            }
            
            function require_#Attributes.Name1#And#Attributes.Name2#And#Attributes.Name3#() {
              return ((require_#Attributes.Name1#And#Attributes.Name2#()) && (require_#Attributes.Name3#()));
            }
                        
            function #FunctionName#(menuNum) {
               OneA.length = 0;
               if (menuNum == null) return;  
                   Trak = menuNum;
                   <!--- ignore if a blank item gets clicked --->
                   <CFIF Attributes.Type1 is "Select">
                   if (document.#Attributes.FormName#.#Attributes.Name1#.options[menuNum].value == '') return;
                   if (document.#Attributes.FormName#.#Attributes.Name1#.options[menuNum].value == null) return;
                   </CFIF>
</CFOUTPUT>


<!--- COUNTER VARIABLE WILL HOLD NUMBER OF GROUPS (OPTIONS IN FIRST SELECT) --->
<CFSET Counter = IIF(Attributes.EmptyText1 is not "", 1, 0)>

<!--- CREATE AN "IF" STATEMENT THAT COVERS EACH ITEM IN THE FIRST SELECT BOX --->
<!--- WITHIN THE "IF" STATMENT, PRE-POPULATE ARRAY WITH CORRESPONDING ITEMS FOR SECOND SELECT  --->

<CFOUTPUT QUERY="customerinfo" GROUP="#Attributes.Display1#">
      if (menuNum == #Counter#) {
        NewOpt = new Array;
            NewVal = new Array;
    <CFSET Counter2 = IIF(Attributes.EmptyText2 is not "", 1, 0)>
    <CFIF Attributes.EmptyText2 is not ""><CFOUTPUT>NewOpt[0] = new Option("#Attributes.EmptyText2#");      NewOpt[0].value = '';      </CFOUTPUT></CFIF>
            <CFOUTPUT GROUP="#Attributes.Display2#">NewOpt[#Counter2#] = new Option("#Evaluate(Attributes.Display2)#");      NewOpt[#Counter2#].value = '#Evaluate(Attributes.Value2)#'; <CFSET Counter2 = Counter2 + 1></CFOUTPUT>
      } <CFSET Counter = Counter + 1>
</CFOUTPUT>


<!--- finish up the ChangeMenu() function --->
<CFOUTPUT>
  tot = NewOpt.length;
      lst = document.#Attributes.FormName#.#Attributes.Name2#.options.length;
      for (i = lst; i > 0; i--) {
        document.#Attributes.FormName#.#Attributes.Name2#.options[i] = null;
      }
  for (i = 0; i < tot; i++) {
        document.#Attributes.FormName#.#Attributes.Name2#.options[i] = NewOpt[i];
      }
  <!--- <CFIF Attributes.AutoSelectFirst is "Yes"> --->
        document.#Attributes.FormName#.#Attributes.Name2#.options[0].selected = true;
      <!--- </CFIF> --->
      #FunctionName2#(0);
}
</CFOUTPUT>




<!--- ALLOW FOR AUTO-SIZING "SHORTCUT" OF SELECT BOXES --->
<CFIF Attributes.Size1 is "Auto">
  <!--- MAKE THE FIRST SELECT BE BIG ENOUGH FOR ALL OF ITS OPTIONS --->
  <CFSET Attributes.Size1 = Counter>
</CFIF>
<CFIF Attributes.Size2 is "Auto">
  <!--- MAKE THE SECOND SELECT BE THE SAME SIZE AS THE FIRST --->
  <CFSET Attributes.Size2 = Attributes.Size1>
</CFIF>
<CFIF Attributes.Size3 is "Auto">
  <!--- MAKE THE SECOND SELECT BE THE SAME SIZE AS THE FIRST --->
  <CFSET Attributes.Size3 = Attributes.Size1>
</CFIF>



<CFOUTPUT>
            function #FunctionName2#() {
               OneA.length = 0;
                   menuNum = Trak;
               //menuNum = document.#Attributes.FormName#.#Attributes.Name1#.selectedIndex;
               menuNum2 = document.#Attributes.FormName#.#Attributes.Name2#.selectedIndex;
               if (menuNum == -1) return;  
               if (menuNum2 == null) return;  
                   <!--- ignore if a the blank item gets clicked --->
                   if (document.#Attributes.FormName#.#Attributes.Name2#.options[menuNum2].value == '') return;
</CFOUTPUT>


<!--- COUNTER VARIABLE WILL HOLD NUMBER OF GROUPS (OPTIONS IN FIRST SELECT) --->
<CFSET Counter1 = 0>

<!--- CREATE AN "IF" STATEMENT THAT COVERS EACH ITEM IN THE FIRST SELECT BOX --->
<!--- WITHIN THE "IF" STATMENT, PRE-POPULATE ARRAY WITH CORRESPONDING ITEMS FOR SECOND SELECT  --->
<CFOUTPUT QUERY="customerinfo" GROUP="#Attributes.Display1#">
if (menuNum == #Counter1#) {
<CFSET Counter = IIF(Attributes.EmptyText2 is not "", 1, 0)>
<CFOUTPUT GROUP="#Attributes.Display2#">
      if (menuNum2 == #Counter#) {
        NewOpt = new Array;
            NewVal = new Array;
    <CFSET Counter2 = IIF(Attributes.EmptyText2 is not "", 1, 0)>
    <CFIF Attributes.EmptyText3 is not "">NewOpt[0] = new Option("#Attributes.EmptyText3#");      NewOpt[0].value = '';      </CFIF>
            <CFOUTPUT>
              NewOpt[#Counter2#] = new Option("#Evaluate(Attributes.Display3)#");
                  NewOpt[#Counter2#].value = '#Evaluate(Attributes.Value3)#';
                  <CFSET Counter2 = Counter2 + 1>
            </CFOUTPUT>
      } <CFSET Counter = Counter + 1>
</CFOUTPUT>      
}      <CFSET Counter1 = Counter1 + 1>
</CFOUTPUT>


<CFOUTPUT>
  tot = NewOpt.length;
      lst = document.#Attributes.FormName#.#Attributes.Name3#.options.length;
      
      for (i = lst; i > 0; i--) {
        document.#Attributes.FormName#.#Attributes.Name3#.options[i] = null;
      }
  for (i = 0; i < tot; i++) {
        document.#Attributes.FormName#.#Attributes.Name3#.options[i] = NewOpt[i];
      }
  <CFIF Attributes.AutoSelectFirst is "Yes">
        document.#Attributes.FormName#.#Attributes.Name3#.options[0].selected = true;
      </CFIF>
}
</SCRIPT>
</CFOUTPUT>

<!--- DONE WITH JAVASCRIPTING.  NOW WE JUST HAVE TO DISPLAY THE FORM ELEMENTS --->







<!--- OUTPUT FIRST FORM ELEMENT --->
<CFIF Attributes.Type1 is "Select">
<CFOUTPUT><SELECT NAME="#Attributes.Name1#" onChange="#FunctionName#(this.selectedIndex)" SIZE="#Attributes.Size1#" <CFIF Attributes.Width1 is not "">STYLE="width:#Attributes.Width1#"</CFIF>></CFOUTPUT>
      <!--- SPECIAL FIRST ITEM, IF REQUESTED --->
      <CFIF Attributes.EmptyText1 is not ""><CFOUTPUT><OPTION VALUE="">#Attributes.EmptyText1#</CFOUTPUT></CFIF>
      <!--- GENERATE REMAINING ITEMS FROM QUERY --->
      <CFOUTPUT QUERY="customerinfo" GROUP="#Attributes.Display1#"><OPTION VALUE="#Evaluate(Attributes.Value1)#"  <CFIF Evaluate(Attributes.Value1) is Attributes.Default1>SELECTED</CFIF>>#Evaluate(Attributes.Display1)#</CFOUTPUT>
      
  <!--- "FORCE WIDTH" OPTION AT BOTTOM, IF REQUESTED --->
      <CFIF Attributes.ForceWidth1 is not ""><CFOUTPUT><OPTION VALUE="">#RepeatString(Attributes.ForceWidthChar, Attributes.ForceWidth1)#</CFOUTPUT></CFIF>
<CFOUTPUT></SELECT></CFOUTPUT>

<CFELSE>
  <!--- RADIO BOXES --->
  <CFSET Counter = 0>
  <CFOUTPUT QUERY="customerinfo" GROUP="#Attributes.Display1#"><INPUT TYPE="Radio" NAME="#Attributes.Name1#" VALUE="#Evaluate(Attributes.Value1)#" <CFIF Evaluate(Attributes.Value1) is Attributes.Default1>CHECKED</CFIF> onClick="#FunctionName#(#Counter#)">#Evaluate(Attributes.Display1)##Attributes.HTMLAfterEachRadio1#<CFSET Counter = Counter + 1></CFOUTPUT>

</CFIF>



<!--- INSERT ANY REQUESTED HTML BETWEEN 1ST AND SECOND ITEMS --->
<CFOUTPUT>#Attributes.HTMLAfter1#</CFOUTPUT>



<!--- OUTPUT SECOND SELECT BOX --->
<CFOUTPUT><SELECT NAME="#Attributes.Name2#" SIZE="#Attributes.Size2#" onChange="#FunctionName2#(this.selectedIndex)" <CFIF Attributes.Width2 is not "">STYLE="width:#Attributes.Width2#"</CFIF>></CFOUTPUT>
      <!--- SPECIAL FIRST ITEM, IF REQUESTED --->
      <CFIF Attributes.EmptyText2 is not ""><CFOUTPUT><OPTION VALUE="">#Attributes.EmptyText2#</CFOUTPUT></CFIF>
      
      <!--- GENERATE REMAINING ITEMS FROM QUERY --->
      <!--- WE ONLY NEED TO OUTPUT THE CHOICES FOR THE FIRST GROUP --->
      <!--- <CFSET FirstGroup = Evaluate("customerinfo.#Attributes.Value1#[1]")> --->
      <CFSET FirstGroup = Attributes.Default1>
      <CFSET CurrentGroup2 = "">
      <CFIF Attributes.EmptyText1 is "">
            <CFLOOP QUERY="customerinfo">
              <CFIF Evaluate("customerinfo.#Attributes.Value1#") is Variables.FirstGroup>
                    <CFSET ThisValue = Evaluate("customerinfo.#Attributes.Value2#")>
                    <CFIF Variables.ThisValue is not Variables.CurrentGroup2>
                      <CFOUTPUT><OPTION VALUE="#Variables.ThisValue#" <CFIF Variables.ThisValue is Attributes.Default2>SELECTED</CFIF>>#Evaluate("customerinfo.#Attributes.Display2#")#</CFOUTPUT>
                        <CFSET CurrentGroup2 = Evaluate("customerinfo.#Attributes.Value2#")>
                        </CFIF>
                  <!--- <CFELSE>
                    <CFBREAK> --->
                  </CFIF>
            </CFLOOP>
      </CFIF>      

  <!--- "FORCE WIDTH" OPTION AT BOTTOM, IF REQUESTED --->
      <CFIF Attributes.ForceWidth2 is not ""><CFOUTPUT><OPTION VALUE="">#RepeatString(Attributes.ForceWidthChar, Attributes.ForceWidth2)#</CFOUTPUT></CFIF>
      <CFIF Attributes.ExtraOptions2 is not ""><CFLOOP INDEX="This" FROM="1" TO="#Attributes.ExtraOptions2#"><CFOUTPUT><OPTION VALUE=""></CFOUTPUT></CFLOOP></CFIF>
<CFOUTPUT></SELECT></CFOUTPUT>



<!--- INSERT ANY REQUESTED HTML BETWEEN 2ND AND 3RD ITEMS --->
<CFOUTPUT>#Attributes.HTMLAfter2#</CFOUTPUT>



<!--- OUTPUT THIRD SELECT BOX --->
<CFOUTPUT><SELECT NAME="#Attributes.Name3#" SIZE="#Attributes.Size3#" <CFIF Attributes.Multiple3 is "Yes">MULTIPLE </CFIF><CFIF Attributes.Width3 is not "">STYLE="width:#Attributes.Width3#"</CFIF><CFIF Attributes.OnChange is not ""> OnChange="#Attributes.OnChange#"</CFIF>></CFOUTPUT>
      <CFSET FirstGroup = Attributes.Default1>
      <CFIF Attributes.EmptyText3 is "">
            <CFLOOP QUERY="customerinfo">
              <CFIF Evaluate("customerinfo.#Attributes.Value1#") is Variables.FirstGroup>
                    <CFSET Hack = Evaluate("customerinfo.#Attributes.Value2#")>
                    <CFSET ThisValue = Evaluate("customerinfo.#Attributes.Value3#")>
                    <CFPARAM NAME="Variables.FirstGroup2" DEFAULT="#Variables.Hack#">
                    <CFIF Evaluate("customerinfo.#Attributes.Value2#") is Variables.FirstGroup2>
                          <CFOUTPUT><OPTION VALUE="#Variables.ThisValue#" <CFIF Variables.ThisValue is Attributes.Default3>SELECTED</CFIF>>#Evaluate("customerinfo.#Attributes.Display3#")#</CFOUTPUT>
                        </CFIF>      
                  </CFIF>
            </CFLOOP>
      </CFIF>      

      <CFIF Attributes.ForceWidth3 is not ""><CFOUTPUT><OPTION VALUE="">#RepeatString(Attributes.ForceWidthChar, Attributes.ForceWidth3)#</CFOUTPUT></CFIF>
      <CFIF Attributes.ExtraOptions3 is not ""><CFLOOP INDEX="This" FROM="1" TO="#Attributes.ExtraOptions3#"><CFOUTPUT><OPTION VALUE=""></CFOUTPUT></CFLOOP></CFIF>
<CFOUTPUT></SELECT></CFOUTPUT>

<!--- <!--- REMOVE THIS AND FIRST LINE IF NOT USING CF3.1 OR LATER --->
<CFSETTING ENABLECFOUTPUTONLY="NO"> --->
0
 

Author Comment

by:asamuel
ID: 10880272
Can you help me if you could please figure out this error, I already have the whole code above
Attribute validation error for tag cfoutput.  
The value of the attribute query, which is currently "customerinfo", is invalid.  
 
The error occurred in C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 220
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\ThreeSelectsRelated.cfm: line 1
Called from C:\Inetpub\wwwroot\ATCTESTnet\Test_request\members_only.cfm: line 66
 
218 : <!--- CREATE AN "IF" STATEMENT THAT COVERS EACH ITEM IN THE FIRST SELECT BOX --->
219 : <!--- WITHIN THE "IF" STATMENT, PRE-POPULATE ARRAY WITH CORRESPONDING ITEMS FOR SECOND SELECT  --->
220 : <CFOUTPUT QUERY="customerinfo" GROUP="#Attributes.Display1#">
221 : if (menuNum == #Counter1#) {
222 : <CFSET Counter = IIF(Attributes.EmptyText2 is not "", 1, 0)>
 
0
 

Author Comment

by:asamuel
ID: 10880896
Hello Guys,
I almost got my answer, the one mrichmon suggest, it will be nice if it will work, I got error, post it above ,
if anyone can help, as soon as possible,really appreciate it
Thanks,
Ashraf
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10881076
I'm not sure - it seems okay....
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10881091
I recommend making a new question called a pointer question worth 20 points and post the error message and a link to this question and ask people to look for the error here....
0
 

Author Comment

by:asamuel
ID: 10924789
Hello Guys,
Can any of the experts help me figure out what is going on, with this code
0
 
LVL 18

Expert Comment

by:Plucka
ID: 10924840
Not sure if this helps, but it means the query doesn't exist.

Are you sure of it's name, and also it's changed names custinfo customerinfo.
0
 

Author Comment

by:asamuel
ID: 10928273
Yes The query name is right so i don't know what else i can do
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now