Hi all,
I am trying to use the custom tag CF_TwoSelectsRelated and I'm running into a strange problem. For some reason Cold Fusion is inserting hard returns into the Javascript that CF_TwoSelectsRelated generates after it's called by my CF page. As a result, when I select an item from select menu 1, it is not updating the options list in select menu 2.
If I view source on the generated page, remove these hard returns, save as html and view in a browser, select menu 2 updates with new options each time I select a new item in select box 1. However, this does little to help me handle live database transactions.
My page that calls the CF_TwoSelectsRelated custom tag:
-----------------------------------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<cfquery datasource="#DataSource#" name="qrysectcat">
SELECT selectID, section, sectcode, catcode, category
FROM sectioncat_test;
</cfquery>
<body>
<FORM ACTION="TestTwoSelectsRelatedGo.cfm" METHOD="POST" onSubmit="return
require_CategoryAndSelection()" NAME="myform">
<CF_TwoSelectsRelated QUERY="qrysectcat" NAME1="sect" NAME2="cat"
DISPLAY1="section" DISPLAY2="category" VALUE1="sectcode" VALUE2="
catcode" SIZE1="Auto" SIZE2="Auto" AUTOSELECTFIRST="No" FORMNAME="myform">
<INPUT TYPE="Submit">
</FORM>
</body>
</html>
-----------------------------------------
My page throws the following javascript error when I browse within Homesite:
"Unterminated string content"
When I view source on the code that CF generates, all of my data is being pulled from the database table but hard returns are being inserted into the "if" statements after each array element before the closing double quotes:
-----------------------------------------
if (menuNum == 0) {
NewOpt = new Array;
NewVal = new Array;
NewOpt[0] = new Option("cat1art
"
; NewOpt[0].value = 'artone'; NewOpt[1] = new Option("cat2art
"
; NewOpt[1].value = 'arttwo'; NewOpt[2] = new Option("cat3art
"
; NewOpt[2].value = 'artthree'; NewOpt[3] = new Option("cat4art
"
; NewOpt[3].value = 'artfour'; NewOpt[4] = new Option("cat5art
"
; NewOpt[4].value = 'artfive'; NewOpt[5] = new Option("cat6art
"
; NewOpt[5].value = 'artsix'; NewOpt[6] = new Option("cat7art
"
; NewOpt[6].value = 'artseven'; NewOpt[7] = new Option("cat8art
"
; NewOpt[7].value = 'arteight'; NewOpt[8] = new Option("cat9art
"
; NewOpt[8].value = 'artnine'; NewOpt[9] = new Option("cat10art
"
; NewOpt[9].value = 'artten';
}
etc...
-----------------------------------------
System:
Windows XP Pro running Cold Fusion Server 6.1 on localhost.
mySQL database on localhost
Browsers: IE 5.5 & Netscape 7
-----------------------------------------
I removed all hard returns in the TwoSelectsRelated custom tag. No effect. I've activated whitespace management in the Cold Fusion administrator. No effect. (Now deactivated). Searched the Macromeida forums as well. No good. I'm stumped.
I can't figure out where these hard returns are coming. Anyone have experience with a similar problem? Thank you in advance for any help on this.
Puzzled,
Ken
I am trying to use the custom tag CF_TwoSelectsRelated and I'm running into a strange problem. For some reason Cold Fusion is inserting hard returns into the Javascript that CF_TwoSelectsRelated generates after it's called by my CF page. As a result, when I select an item from select menu 1, it is not updating the options list in select menu 2.
If I view source on the generated page, remove these hard returns, save as html and view in a browser, select menu 2 updates with new options each time I select a new item in select box 1. However, this does little to help me handle live database transactions.
My page that calls the CF_TwoSelectsRelated custom tag:
-----------------------------------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<cfquery datasource="#DataSource#" name="qrysectcat">
SELECT selectID, section, sectcode, catcode, category
FROM sectioncat_test;
</cfquery>
<body>
<FORM ACTION="TestTwoSelectsRelatedGo.cfm" METHOD="POST" onSubmit="return
require_CategoryAndSelection()" NAME="myform">
<CF_TwoSelectsRelated QUERY="qrysectcat" NAME1="sect" NAME2="cat"
DISPLAY1="section" DISPLAY2="category" VALUE1="sectcode" VALUE2="
catcode" SIZE1="Auto" SIZE2="Auto" AUTOSELECTFIRST="No" FORMNAME="myform">
<INPUT TYPE="Submit">
</FORM>
</body>
</html>
-----------------------------------------
My page throws the following javascript error when I browse within Homesite:
"Unterminated string content"
When I view source on the code that CF generates, all of my data is being pulled from the database table but hard returns are being inserted into the "if" statements after each array element before the closing double quotes:
-----------------------------------------
if (menuNum == 0) {
NewOpt = new Array;
NewVal = new Array;
NewOpt[0] = new Option("cat1art
"
"
"
"
"
"
"
"
"
"
}
etc...
-----------------------------------------
System:
Windows XP Pro running Cold Fusion Server 6.1 on localhost.
mySQL database on localhost
Browsers: IE 5.5 & Netscape 7
-----------------------------------------
I removed all hard returns in the TwoSelectsRelated custom tag. No effect. I've activated whitespace management in the Cold Fusion administrator. No effect. (Now deactivated). Searched the Macromeida forums as well. No good. I'm stumped.
I can't figure out where these hard returns are coming. Anyone have experience with a similar problem? Thank you in advance for any help on this.
Puzzled,
Ken