but strangely enough, cfmx doesn't barf on nested cfoutputs. ...tony
Tony Weeg Senior Web Developer UnCertified Advanced ColdFusion Developer Information System Design Navtrak, Inc. Mobile workforce monitoring, mapping & reporting www.navtrak.net 410.548.2337 -----Original Message----- From: Jason Lees (National Express) [mailto:[EMAIL PROTECTED]] Sent: Monday, January 06, 2003 11:41 AM To: CF-Talk Subject: RE: Loop Errors the simple answer about the nested <cfoutput> tags is whats the point? and so the parser catches the nested <cfoutput> tags as a coding error. Its like doing <cfoutput> #myVar1# <cfoutput> #MyVar2# </cfoutput> </cfoutput> Jason Lees Development Team Leader National Express Coaches Ltd. -----Original Message----- From: Ian Vaughan [mailto:[EMAIL PROTECTED]] Sent: 06 January 2003 16:25 To: CF-Talk Subject: Re: Loop Errors Thanks For the replies Taking them in no particular order Jason Lees said "Well for a start you dont neet to nest the <cfoutput>'s" Why don't I need to nest the cfoutputs? Jeff Garza and Mosh Teitelbaum picked up on the same point, jeff said.............. "I beleive that you have referenced the query wrong. Try: <cfoutput query="rsquery1" group="category">" I know what you are saying however, the query is linked to the output of the actual select shown below <option value="0">Select ATA Code <cfoutput query="rsATA1" group="category"> <option value="#ATA_Chapter#">#category# </cfoutput> If you look at my code you should see this...... Jerry Johnson said "<cfoutput> <cfset i = i + 1> ChapterArray#category#[#i#] = #category#; ChapterArrayVal#category#[#i#] = "#catno# #category#"; </cfoutput> </cfoutput>" why do you think I dont need this?? The code I am using is based on the code below , which works but I think they were using two tables I am only using one table?? From this you may be able to solve some of these problems??? ---------------------------ORIGINAL---------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <!--- Select the ATA_Chapter, ATA_Section and title_Codes. ---> <cfquery name="rsquery1" datasource="ATA"> SELECT a.ata_chapter, a.ata_title, b.ata_section, b.ATA_TITLE SubTitle FROM ata_codes a, ata_sub_codes b WHERE a.ata_chapter = b.ata_chapter ORDER BY a.ata_chapter, b.ata_section </cfquery> <!--- Select all the sub codes. ---> <script language = "JavaScript"> <!-- // For each chapter, create an array to hold the sections. // Each chapter array will be identified by the ATA_Chapter <cfoutput query="rsATA1" group="ATA_Chapter"> // Create the array ChapterArray#ATA_Chapter# = new Array(); ChapterArrayVal#ATA_Chapter# = new Array(); <cfset i = 0> // Populate the array <cfoutput> <cfset i = i + 1> ChapterArray#ATA_Chapter#[#i#] = #ATA_Chapter#; ChapterArrayVal#ATA_Chapter#[#i#] = "#ata_section# #SubTitle#"; </cfoutput> </cfoutput> // Function to populate the ATA_Sub_Codes for the ATA_Code selected function PopulateATASubCode() { // Only process the function if the first item is not selected. var indx = document.InsertForm.ATACode.selectedIndex; if (indx != 0) { // Find the Chapter var ThisChapter = document.InsertForm.ATACode[indx].value; // Set the length of the ATA_Sub_Codes drop down equal to the length of the Chapter's array var len; len = eval("ChapterArray" + ThisChapter + ".length"); document.InsertForm.ATA_SubCode.length = len; // Put 'Select' as the first option in the SubCode drop-down document.InsertForm.ATA_SubCode[0].value = ""; document.InsertForm.ATA_SubCode[0].text = "Select ATA Sub Code"; document.InsertForm.ATA_SubCode[0].selected = true; // Loop through the chapter's array and populate the SubCode drop down. for (i=1; i<len; i++) { document.InsertForm.ATA_SubCode.value = eval("ChapterArray" + ThisChapter + ""); document.InsertForm.ATA_SubCode.text = eval("ChapterArrayVal" + ThisChapter + ""); } } } //--> </script> <html> <head> <title>Requirements Database Add Requirement</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form action="<cfoutput>#CurrentPage#</cfoutput>" method="POST" name="InsertForm" id="InsertForm"> <table> <tr> <td> <select name="ATACode" onChange="PopulateATASubCode();"> <option value="0">Select ATA Code <cfoutput query="rsATA1" group="ATA_Chapter"> <option value="#ATA_Chapter#">#ATA_Chapter# #ATA_Title# </cfoutput> </select> <select name="ATA_SubCode" size="1"> <option value="0">Select ATA Sub Code </select></td> </tr> </table> </body> </html> ----- Original Message ----- From: "Jason Lees (National Express)" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, January 06, 2003 3:55 PM Subject: RE: Loop Errors > Well for a start you dont neet to nest the <cfoutput>'s > > > Jason Lees > Development Team Leader > National Express Coaches Ltd. > > > > -----Original Message----- > From: Ian Vaughan [mailto:[EMAIL PROTECTED]] > Sent: 06 January 2003 15:50 > To: CF-Talk > Subject: Loop Errors > > > Does anybody have any ideas on why I am getting a loop error from my code > below I cant see why this is happening, any suggestions would be most > helpful thanks... > > Error Occurred While Processing Request > Error Diagnostic Information > Loop error > > > The error occurred while processing an element with a general identifier of > (CFOUTPUT), occupying document position (23:1) to (23:42). > > > Date/Time: Mon Jan 06 15:49:37 2003 > Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) > Remote Address: 121.100.25.2 > > > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > > <html> > <head> > <title>Untitled</title> > </head> > > <body> > <!--- Select the ATA_Chapter, ATA_Section and title_Codes. ---> > <cfquery name="rsquery1" datasource="intranetv8"> > SELECT a.category, a.catno, a.parent_level, b.category, b.catno, > b.parent_level > FROM category_menu a, category_menu b > > WHERE a.parent_level = b.catno > > ORDER BY a.category, b.category > </cfquery> > <!--- Select all the sub codes. ---> > <script language = "JavaScript"> > <!-- > // For each chapter, create an array to hold the sections. > // Each chapter array will be identified by the ATA_Chapter > <cfoutput query="rsATA1" group="category"> > // Create the array > ChapterArray#category# = new Array(); > ChapterArrayVal#category# = new Array(); > <cfset i = 0> > // Populate the array > <cfoutput> > <cfset i = i + 1> > ChapterArray#category#[#i#] = #category#; > ChapterArrayVal#category#[#i#] = "#catno# #category#"; > </cfoutput> > </cfoutput> > > > // Function to populate the ATA_Sub_Codes for the ATA_Code selected > function PopulateATASubCode() { > // Only process the function if the first item is not selected. > var indx = document.InsertForm.ATACode.selectedIndex; > if (indx != 0) { > // Find the Chapter > var ThisChapter = document.InsertForm.ATACode[indx].value; > // Set the length of the ATA_Sub_Codes drop down equal to the length of the > Chapter's array > var len; > len = eval("ChapterArray" + ThisChapter + ".length"); > document.InsertForm.ATA_SubCode.length = len; > // Put 'Select' as the first option in the SubCode drop-down > document.InsertForm.ATA_SubCode[0].value = ""; > document.InsertForm.ATA_SubCode[0].text = "Select ATA Sub Code"; > document.InsertForm.ATA_SubCode[0].selected = true; > // Loop through the chapter's array and populate the SubCode drop down. > for (i=1; i<len; i++) { > document.InsertForm.ATA_SubCode.value = eval("ChapterArray" + ThisChapter + > ""); > document.InsertForm.ATA_SubCode.text = eval("ChapterArrayVal" + ThisChapter > + ""); > } > } > } > //--> > </script> > > <html> > <head> > <title>Requirements Database Add Requirement</title> > <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> > </head> > <body> > <form action="<cfoutput>#CurrentPage#</cfoutput>" method="POST" > name="InsertForm" id="InsertForm"> > <table> > <tr> > <td> <select name="ATACode" onChange="PopulateATASubCode();"> > <option value="0">Select ATA Code <cfoutput query="rsATA1" group="category"> > <option value="#ATA_Chapter#">#category# </cfoutput> > </select> > <select name="ATA_SubCode" size="1"> > <option value="0">Select ATA Sub Code > </select></td> > </tr> > </table> > > > > </body> > </html> > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4