Element ADDRESS_VALUE is undefined in FORM
Hello,
I have a coldfusion 7 search that is querying a database through a form containing text inputs and pull-down menus. However, one of the options is returning the following message: Also, I only get this in Mozilla and Safaru web browsers, it works fine in IE. Why would this be? Any help would be greatly appreciated.
Thanks ![]()
Element ADDRESS_VALUE is undefined in FORM.
The error occurred in F:\surveyor\WEB_TEST\gis\map\map_search\enterprise\mon_add_results.cfm: line 10
8 : <cfset error = " "> 9 : <!---Check if a name has been provided---> 10 : <cfif len(form.address_value) is 0> 11 : <cfset valid = false> 12 :
Here is my code:
mon_by_address.cfm
<HTML>
<HEAD>
<TITLE>Enter an address</TITLE>
<LINK rel="stylesheet" href="../../../../css/ss.css" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
function Address_tips()
{
window.open("mon_add_tips.html","tips","width=500,height=400,directories=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no");
}
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" topmargin="2" leftmargin="2" rightmargin="2">
<cfform method="post" target="outputframe" name="address" action="mon_add_results.cfm">
<table width="185" border=0 bordercolor="black" cellpadding="0" cellspacing="0" >
<tr>
<td >
<h2 class="m1right">Address: </h2>
</td>
<td align="left" >
<cfselect name="address_operator" class="whiteonblack">
<option value="contains">contains</option>
<option value="begins_with">starts with</option>
<option value="is">is exactly</option>
</cfselect>
</td>
</tr>
<tr>
<td >
<h2 class="m1right">The Number: </h2>
</td>
<td align="left">
<INPUT type="text" size="14" name="address_value" class="whiteonblack" >
</td>
</tr>
<tr>
<td >
<h2 class="m1right">Sort By: </h2>
</td>
<td align="left">
<cfselect name="field" class="whiteonblack">
<option value="grid_address">Grid Address</option>
<option value="township_range">Township/Range</option>
<option value="point_name"><font color = "black">Point name</option>
</cfselect>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<a href="mon_add_results.cfm" target="outputframe"> <input type="Submit" value="go" name="submit" ></a>
</td>
<td>
<!--- <a href="javascript:Address_tips();">Tips</a>--->
</td>
</tr>
</table>
</cfform>
</DIV>
</BODY>
</HTML>
mon_add_results.cfm
<!--start validation testing--->
<cfset valid = true>
<cfset error = " ">
<!---Check if a name has been provided--->
<cfif len(form.address_value) is 0>
<cfset valid = false>
</cfif>
<cfif not valid>
<table bgcolor="#FFFFFF" width="100%" align=center border="0" bordercolor="black" cellspacing=0 cellpading=0 >
<tr>
<td><br>
<h4 class="noresult">Sorry, your seach returned no results.</h4>
</td>
</tr>
</table>
<cfelse>
<!---end validation testing--->
<CFQUERY name="by_address" datasource="sire" dbtype="odbc">
select *
FROM sire.dbo.control_doc
WHERE sire.dbo.control_doc.publish = 'yes'
and
<cfif form.address_operator IS "contains">
sire.dbo.control_doc.grid_address like '%#form.address_value#%'
<cfelseif form.address_operator IS "begins_with">
sire.dbo.control_doc.grid_address like '#form.address_value#%'
<cfelseif form.address_operator IS "is">
sire.dbo.control_doc.grid_address like '#form.address_value#'
</cfif>
<CFIF Not IsDefined("FORM.field")>
ORDER BY grid_address
<cfelseif form.field is "grid_address">
ORDER BY control_doc.grid_address
<cfelseif form.field is "township_range">
ORDER BY control_doc.township_range,section
<cfelseif form.field is "point_name">
ORDER BY control_doc.point_name
</cfif>
</CFQUERY>
<cfif by_address.recordcount greater than 0>
<html>
<head>
<title>Untitled</title>
<LINK rel="stylesheet" href="/css/ss.css" type="text/css">
</head>
<body topmargin="0" leftmargin="5" bgcolor="#FFFFFF">
<table cellspacing=0 cellpading=0>
<tr>
<td>
<cfoutput>
<cfform method="post" name="text" target="top" action="add_mon.cfm">
<cfselect name="text" size=1 class="drop">
<option>#form.address_value#</option>
</cfselect>
<cfselect name="field" size=1 class="drop">
<option>#form.field#</option>
</cfselect>
<cfselect name="address_operator" size=1 class="drop">
<option>#form.address_operator#</option>
</cfselect>
</td>
</tr>
<tr>
<td>
<input type="Button" value="Print List" name="button" onClick="window.print()"></a> <a href="add_mon.cfm" target="top"><input type="Submit" value="View Text" name="submit" ></a> <input type="Button" value="Text Help" name="button" onClick="javascript:help_key();">
</td>
</tr>
</cfform>
</cfoutput>
</table>
<table width="1005" align="middle" border="1" bordercolor="#000000" bgcolor="gray" cellspacing=0 cellpading=0 >
<tr border="1" bgcolor="#ffffff">
<td bordercolor="gray" colspan=13>
<h4><!---<cfoutput > #rc# Results</cfoutput>--->
*NAD83 StatePlane Utah Central Zone (Elevations are in Meters)</h4>
</td>
<td colspan=4>
<a href="javascript:mon_key();" class="ss3">Key to Mon. Abbreviations</a>
</td>
</tr>
<tr bgcolor="LightCoral" border="1" bordercolor="gray">
<td width=30><h4 class="mon_fields">Result <b>#</b></h4></td>
<td width=65><h4 class="mon_fields">Point Name</h4></td>
<td width=34 ><h4 class="mon_fields">Zoom</h4></td>
<td width=75><h4 class="mon_fields">Mon. Ref. Sheet</h4></td>
<td width=95><h4 class="mon_fields">Grid Address</h4></td>
<td width=60><h4 class="mon_fields">Township<br>& Range</h4></td>
<td width=35><h4 class="mon_fields">Section</h4></td>
<td width=80><h4 class="mon_fields">Northing</h4></td>
<td width=75><h4 class="mon_fields">Easting</h4></td>
<td width=75><h4 class="mon_fields">Differential<br>Elevation</h4></td>
<td width=75><h4 class="mon_fields">RTK<br>Elevation</h4></td>
<td width=90><h4 class="mon_fields">Latitude</h4></td>
<td width=95><h4 class="mon_fields">Longitude</h4></td>
<td width=75><h4 class="mon_fields">Monument<br>Type</h4></td>
<td width=75><h4 class="mon_fields">Monument<br>Description</h4></td>
<td width=75><h4 class="mon_fields">Monument<br>Notes</h4></td>
</tr>
<cfset rowcount=1>
<cfoutput query="by_address">
<tr bgcolor="###Iif(((CurrentRow MOD 2) is 0),de('ffffff'),de('d3d3d3'))#" border="1" bordercolor="gray"><!---alternates row colors--->
<td width=30><h4>#rowcount#</h4></td>
<cfset rowcount=rowcount+1>
<td width="65"><h4>#Point_Name#</h4></td>
<td width=34><h4> <a href="javascript:getinfomon('#Point_Name#');"><img src="../../../../images/mag.gif" align="middle" alt="Zoom to Monument #Point_Name#" border=0></a></td>
<td width="75"><h4> <a href="mrs_test.cfm?mrspoint=#Point_Name#&nor=#Northing#&east=#Easting#" target="_blank" class="ss3"><img src="../../../../images/mrs_icon.gif" border="0"></a></h4></td>
<td width="95"><h4>#Grid_Address#</h4></td>
<td width="60"><h4>#Township_Range#</h4></td>
<td width="35"><h4>#Section#</h4></td>
<td width="80"><h4>#Northing#</h4></td>
<td width="75"><h4>#Easting#</h4></td>
<td width="75"><h4>#Elevation_Diff#</h4></td>
<td width="75"><h4>#elevation_rtk#</h4></td>
<td width="90"><h4>#Latitude_DMS#</h4></td>
<td width="95"><h4>#Longitude_DMS#</h4></td>
<td width="75"><h4>#Mon_type#</h4></td>
<td width="75"><h4>#Mon_description#</h4></td>
<td width="75"><h4>#Mon_notes#</h4></td>
</tr>
</cfoutput>
</table>
<cfelse>
<table width=725 align=center border="0" bordercolor="black" cellspacing=0 cellpading=0 >
<tr>
<td align=center colspan=8><br><br>
<h4 class="noresult">Your search returned no results. Please try again.</h4>
</td>
</tr>
</table>
</body></html></cfif>
</cfif>
