Question
undefined <VARIABLE> in FORM
Dear All,
Another post with a classic "undefined <VARIABLE> in FORM" error message I'm afraid. I don't think this is the usual problem of scoping however or form not submitting the data. Basically I've checked and triple checked the file with the <cfform> tag in it and it definately contains the relevant controls with the names correct. I've also put <cfdump var="#Form#"><cfabort> tags at the top of each file to ensure the information is getting through. Looking at the Form structure I can see the variables that are being posted (all of which have the values passed from the file with the form tag). However, despite this, when I remove the <cfabort> tag to let the website process then the error message returns. I can't think of what else might be causing this. Any ideas?
The actual .cfm files are pretty long but the jist of them is as follows:
<!-- calling.cfm - a file that contains a form -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>A title</title>
</head>
<body>
<CFSET avariable=10> <!-- In the actual file avariable comes from a database -->
<CFFORM name="aform" action="beingcalled.cfm">
<CFINPUT name="aformvar" type="hidden" value=#avariable#>
<CFINPUT name="action" type="submit" value="Press Me">
</CFFORM>
</body>
</html>
<!-- beingcalled.cfm - a file that has form variables added to it -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>A title</title>
</head>
<body>
<CFDUMP var="#Form#"> <This shows aformvar as part of the form structure>
<!-- Do something with Form.aformvar here -->
<CFIF Form.aformvar EQ 10> <!-- THIS DOESN'T PROCESS - ERROR IS RETURNED -->
I should be displayed
</CFIF>
</body>
</html>
I am using coldfusion 7.
Many thanks in advance,
Another post with a classic "undefined <VARIABLE> in FORM" error message I'm afraid. I don't think this is the usual problem of scoping however or form not submitting the data. Basically I've checked and triple checked the file with the <cfform> tag in it and it definately contains the relevant controls with the names correct. I've also put <cfdump var="#Form#"><cfabort> tags at the top of each file to ensure the information is getting through. Looking at the Form structure I can see the variables that are being posted (all of which have the values passed from the file with the form tag). However, despite this, when I remove the <cfabort> tag to let the website process then the error message returns. I can't think of what else might be causing this. Any ideas?
The actual .cfm files are pretty long but the jist of them is as follows:
<!-- calling.cfm - a file that contains a form -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>A title</title>
</head>
<body>
<CFSET avariable=10> <!-- In the actual file avariable comes from a database -->
<CFFORM name="aform" action="beingcalled.cfm">
<CFINPUT name="aformvar" type="hidden" value=#avariable#>
<CFINPUT name="action" type="submit" value="Press Me">
</CFFORM>
</body>
</html>
<!-- beingcalled.cfm - a file that has form variables added to it -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>A title</title>
</head>
<body>
<CFDUMP var="#Form#"> <This shows aformvar as part of the form structure>
<!-- Do something with Form.aformvar here -->
<CFIF Form.aformvar EQ 10> <!-- THIS DOESN'T PROCESS - ERROR IS RETURNED -->
I should be displayed
</CFIF>
</body>
</html>
I am using coldfusion 7.
Many thanks in advance,