Skip to main content
Participating Frequently
May 1, 2020
Question

Error Occurred While Processing Request Element REQUESTOR is undefined in FORM.

  • May 1, 2020
  • 4 replies
  • 2623 views

I am taking over for someone that coded a page a long time ago and is no longer at our office.  I am having a heck of a time figuring out why i keep getting this error.  This seemed to work yesterday and not sure what changes were made but when i go to submit this page i get this error and can't figure it out.  any help would be greatly appreciated it.

<!--- Get the info needed --->

<cfquery name="Requestor" datasource="" username="" password="">
SELECT *
FROM v_employeeinformation
ORDER BY v_employeeinformation.Last_Name
</cfquery>

<!---
<cfquery name="Recordset1" datasource="" username="" password="">
SELECT * FROM v_helpdesk
</cfquery>
--->

<cfquery name="OITAssigned" datasource="" username="" password="">
SELECT *
FROM v_employeeinformation
WHERE v_employeeinformation.Department LIKE 'Information Technology'
ORDER BY v_employeeinformation.Last_Name
</cfquery>
<cfquery name="OITStaff" datasource="" username="" password="">
SELECT *
FROM v_employeeinformation
WHERE v_employeeinformation.Department LIKE 'Information Technology'
ORDER BY v_employeeinformation.Last_Name
</cfquery>

<cfquery name="Recordset3" datasource="" username="" password="">
SELECT * FROM v_helpdesklists ORDER BY v_helpdesklists.Category
</cfquery>

<!--- End Getting the info needed --->

 

<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "form1">

<!--- Include the CFIF to insert right category --->
<CFINCLUDE template="cfif_category.cfm">

<cfquery datasource="">
UPDATE v_helpdeskfindnames SET Summary=
<cfif IsDefined("FORM.Summary") AND #FORM.Summary# NEQ "">
'#FORM.Summary#'
<cfelse>
NULL
</cfif>
, Requestor=#FORM.Requestor#, OIT_Staff=#FORM.OIT_Staff#, Priority=
<cfif IsDefined("FORM.Priority") AND #FORM.Priority# NEQ "">
'#FORM.Priority#'
<cfelse>
NULL
</cfif>
, Open_Date=
<cfif IsDefined("FORM.Open_Date") AND #FORM.Open_Date# NEQ "">
'#FORM.Open_Date#'
<cfelse>
NULL
</cfif>
, Min_Spent=
<cfif IsDefined("FORM.Min_Spent") AND #FORM.Min_Spent# NEQ "">
'#FORM.Min_Spent#'
<cfelse>
NULL
</cfif>
, OIT_Time_Spent=
<cfif IsDefined("FORM.OIT_Time_Spent") AND #FORM.OIT_Time_Spent# NEQ "">
'#FORM.OIT_Time_Spent#'
<cfelse>
NULL
</cfif>
, Close_Date=
<cfif IsDefined("FORM.Close_Date") AND #FORM.Close_Date# NEQ "">
'#FORM.Close_Date#'
<cfelse>
NULL
</cfif>
, Description=
<cfif IsDefined("FORM.Description") AND #FORM.Description# NEQ "">
'#FORM.Description#'
<cfelse>
NULL
</cfif>
, Solution=
<cfif IsDefined("FORM.Solution") AND #FORM.Solution# NEQ "">
'#FORM.Solution#'
<cfelse>
NULL
</cfif>
, Type=
<cfif IsDefined("FORM.Type") AND #FORM.Type# NEQ "">
'#FORM.Type#'
<cfelse>
NULL
</cfif>
, Category=
<cfif IsDefined("FORM.Category") AND #FORM.Category# NEQ "">
'#FORM.Category#'
<cfelse>
NULL
</cfif>
WHERE Ticket_Num=#form.Ticket_Num#
</cfquery>
<cflocation url="editticketaction.cfm">
</cfif>

<cfquery name="Recordset1" datasource="" username="" password="">
SELECT *
FROM v_helpdeskfindnames
WHERE v_helpdeskfindnames.Ticket_Num LIKE '#url.Ticket_Num#'
</cfquery>

<!--- sample code for select

<select name="select" name="userName">
<cfoutput query="getUser">
<option value="#id_user_pk#" <cfif #URL.idUser# EQ #id_user_pk#>selected="selected"</cfif>>#name#</option>
</cfoutput>

--->

<html>
<head>
<title>Edit Ticket - OIT Helpdesk Tracker</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- American format mm/dd/yyyy -->
<script language="JavaScript" src="calendar2.js"></script><!-- Date only with year scrolling -->
</head>

<body>
<cfset currentdate = DateFormat(now(), 'mmm dd, yyyy')>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="Images/heading.gif" width="332" height="31"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="29" colspan="2"> <table width="100%" height="33" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="33" bgcolor="91db5a">
<TABLE width="100%" height=33 border=0 cellPadding=0 cellSpacing=0 bgColor=#91db5a>
<TBODY>
<TR>
<TD width="89" noWrap bgColor=#c8edad><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>&nbsp;
<a href="index.cfm">&nbsp;<FONT color=black>Home</FONT></a>
&nbsp;</STRONG></font></TD>
<TD width="348" noWrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>&nbsp;
<A
href="http://www.visualpharm.com/faq.html"></A> &nbsp;</STRONG></font><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>&nbsp;
<A
href="http://www.visualpharm.com/overview.html"></A> &nbsp;</STRONG></font><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><STRONG>&nbsp;
<A
href="http://www.visualpharm.com/contacts.html"></A> &nbsp;</STRONG></font></TD>
<td width="332"><div align="right"><font color="#FFFFFF" size="4" face="Verdana, Arial, Helvetica, sans-serif"></font></div></td>
</TR>
</TBODY>
</TABLE>
</td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"><table width="100%" height="60" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="28%" bgcolor="#f3fced">&nbsp;</td>
<td width="72%" bgcolor="#e6f9d8">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td height="15">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="138" colspan="2">
<table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td colspan="3" valign="bottom">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%"><div align="center">
<form method="post" name="form1" action="<cfoutput>#CurrentPage#</cfoutput>">
<table width="100%" border="0">
<tr>
<td height="45" colspan="4"><div align="center"><img src="Images/editticketheading.gif" width="140" height="33"></div></td>
</tr>
<tr>
<td width="14%"><div align="left"><font color="#69C029"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Ticket Number </font></strong></font></div></td>
<td width="34%"><cfoutput><strong><font color="##69C029" size="2" face="Verdana, Arial, Helvetica, sans-serif">#Recordset1.Ticket_Num#</font></strong></cfoutput></td>
<td width="15%"><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#69C029" size="2">Ticket Creator</font></strong></font></div></td>
<td width="37%"><strong><cfoutput><font color="##69C029" size="2" face="Verdana, Arial, Helvetica, sans-serif">#Recordset1.ITStaffPreferredName# #Recordset1.ITStaffLastName#</font></cfoutput></td>
</tr>
<tr>
<td><div align="left"><font color="#69C029"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Summary</font></strong></font></div></td>
<td><input type="text" name="Summary" value="<cfoutput>#Recordset1.Summary#</cfoutput>" size="32"></td>
<td width="20%"><strong><font color="#69C029" size="2" face="Verdana, Arial, Helvetica, sans-serif">OIT Staff Assigned</font></strong></td>
<td><strong><cfoutput><font color="##69C029" size="2" face="Verdana, Arial, Helvetica, sans-serif">#Recordset1.ITAssignedPreferredName# #Recordset1.ITAssignedLastName#</font></cfoutput></td>
</tr>
<tr>
<td><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#69C029" size="2">Requestor</font></strong></font></div></td>
<td><strong><cfoutput><font color="##69C029" size="2" face="Verdana, Arial, Helvetica, sans-serif">#Recordset1.RequestorPreferredName# #Recordset1.RequestorLastName#</font></cfoutput></td>
<!--
<td><div align="left"><font color="#69C029"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Type</font></strong></font></div></td>
<td><div align="left"><font color="#69C029"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><cfoutput>#Recordset1.Type#</cfoutput></font></strong></font>
-->
</td>
<td>
<div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#69C029" size="2">Priority</font></strong></font></div></td>
<td>

<select name="Priority" required="yes">
<option value="High" <cfif #Recordset1.Priority# EQ "High">selected="selected"</cfif>>High</option>
<option value="Medium" <cfif #Recordset1.Priority# EQ "Medium">selected="selected"</cfif>>Medium</option>
<option value="Low" <cfif #Recordset1.Priority# EQ "Low">selected="selected"</cfif>>Low</option>
</select>

</td>
</tr>
<tr>
<td><div align="left"><font color="#69C029"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Category</font></strong></font></div></td>
<td>

<select name="Category" name="Category1">
<cfoutput query="Recordset3">
<option value="#Category#" <cfif #Recordset1.Category# EQ #Category#>selected="selected"</cfif>>#Recordset3.Category#</option>
</cfoutput>

</td>
<td><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#69C029" size="2">Date Requested</font></strong></font></div></td>
<td><input type="text" name="Open_Date" value="<cfoutput>#DateFormat(Recordset1.Open_Date, 'mm/dd/yyyy')#</cfoutput>" size="32">&nbsp;<a href="javascript&colon;cal4.popup();"><img src="Images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a></td>
</tr>
<tr>
<td><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#69C029" size="2">Minutes Spent</font></div></td>
<td><input type="text" name="Min_Spent" value="<cfoutput>#Recordset1.Min_Spent#</cfoutput>" size="5"></td>
<td><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#69C029" size="2">Date Completed </font></strong></font></div></td>
<td><input type="text" name="Close_Date" value="<cfoutput>#DateFormat(Recordset1.Close_Date, 'mm/dd/yyyy')#</cfoutput>" size="32">&nbsp;<a href="javascript&colon;cal5.popup();"><img src="Images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><strong><font color="#69C029" size="2" face="Verdana, Arial, Helvetica, sans-serif">OIT Time Spent</font></strong></td>
<td><input type="text" name="OIT_Time_Spent" value="<cfoutput>#Recordset1.OIT_Time_Spent#</cfoutput>" size="5">&nbsp;<font color="#69C029" size="2" face="Verdana, Arial, Helvetica, sans-serif">(minutes)</font> </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><div align="left"><font color="#69C029"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Problem</font></strong></font></div></td>
<td>&nbsp;</td>
<td><div align="left"><font face="Verdana, Arial, Helvetica, sans-serif"><strong><font color="#69C029" size="2">Solution</font></strong></font></div></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><textarea name="Description" cols="40" rows="8"><cfoutput>#Recordset1.Description#</cfoutput></textarea></td>
<td>&nbsp;</td>
<td><textarea name="Solution" cols="40" rows="8"><cfoutput>#Recordset1.Solution#</cfoutput></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><input type="submit" value="Update record"></td>
</tr>
</table>
<input type="hidden" name="MM_UpdateRecord" value="form1">
<br>
</form>

<script language="JavaScript">
<!-- // create calendar object(s) just after form tag closed
// specify form element as the only parameter (document.forms['formname'].elements['inputname']);
// note: you can have as many calendar objects as you need for your application
var cal4 = new calendar2(document.form1.Open_Date);
cal4.year_scroll = true;
cal4.time_comp = false;
var cal5 = new calendar2(document.form1.Close_Date);
cal5.year_scroll = true;
cal5.time_comp = false;
//-->
</script>
<p>&nbsp;</p>
</div></td>
</tr>
</table></td>
</tr>
</table>

<br>
<div align="center"></div>




</td>
</tr>
<tr bgcolor="#e6f9d8">
<td colspan="2">&nbsp;</td>
</tr>
</table>
</body>
</html>

    This topic has been closed for replies.

    4 replies

    Participating Frequently
    May 4, 2020

    Thank you thank you all for the help. It pointed me in the right direction.  I cleaned up some things you all suggested and I am still not sure how but this is back to working.  Thank you all for taking the time to help me out.  I ended up doing everything you all suggestted

    Charlie Arehart
    Community Expert
    Community Expert
    May 4, 2020

    Great to hear, and thanks for the update. 

    /Charlie (troubleshooter, carehart. org)
    Participating Frequently
    May 4, 2020

    I spoke too soon.  I cleared out all the FORM. that  was all discussed here and i toasted my table it updated but updated every single tick the same.  Well back at it i go.

    BKBK
    Community Expert
    Community Expert
    May 3, 2020

    It is apparent, as others have said, that the error is caused because the submitted form contains no field named Requestor. This is very likely to be true. But there is another possibility.

     

    Just before the first line referring to form.Requestor, there is a cfinclude. If the included page cfif_category.cfm had contained some code similar to <cfparam name = "form.Requestor" default = "the_default_requestor">, then the error would not have occurred.  This may sound like a purely academic question. But I am including it just for the sake of completeness. You never know. It might or might not be what you had in mind.

     

    In any case, there are at least 4 more form-scoped variables for which the fields are missing in the form. They are:

     

    OIT_Staff
    Open_Date
    Type
    Ticket_Num

     

    I would suggest you create a new test page just for debugging. Exclude from it the CSS, Javascript and table elements. The page should contain just the query, form and any code relevant to the form and query.  

     

    See example below. Such simplification will enable you to debug the code faster. It will also enable you to see where you could make the code more efficient. For example, the use of just one pair of cfoutput tags at the beginning and end of the form.

     

    When you no longer get errors, you could then copy code from the test page back to the original page.

     

     

     

     

     

    <!--- Get the info needed --->
    
    <cfquery name="Requestor" datasource="" username="" password="">
    SELECT *
    FROM v_employeeinformation
    ORDER BY v_employeeinformation.Last_Name
    </cfquery>
    
    <cfquery name="OITAssigned" datasource="" username="" password="">
    SELECT *
    FROM v_employeeinformation
    WHERE v_employeeinformation.Department LIKE 'Information Technology'
    ORDER BY v_employeeinformation.Last_Name
    </cfquery>
    
    <cfquery name="OITStaff" datasource="" username="" password="">
    SELECT *
    FROM v_employeeinformation
    WHERE v_employeeinformation.Department LIKE 'Information Technology'
    ORDER BY v_employeeinformation.Last_Name
    </cfquery>
    
    <cfquery name="Recordset3" datasource="" username="" password="">
    SELECT * FROM v_helpdesklists ORDER BY v_helpdesklists.Category
    </cfquery>
    
    
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    
    <cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "form1">
    
    <!--- Include the CFIF to insert right category --->
    <CFINCLUDE template="cfif_category.cfm">
    
    <cfquery datasource="">
    UPDATE v_helpdeskfindnames SET Summary=
    <cfif IsDefined("FORM.Summary") AND FORM.Summary NEQ "">
    '#FORM.Summary#'
    <cfelse>
    NULL
    </cfif>
    <!--- I have modified the following 2 ifs --->
    <cfif IsDefined("FORM.Requestor")>, Requestor=#FORM.Requestor#</cfif>
    <cfif IsDefined("FORM.OIT_Staff")>, OIT_Staff=#FORM.OIT_Staff#</cfif>
     Priority=<cfif IsDefined("FORM.Priority") AND FORM.Priority NEQ "">
    ,'#FORM.Priority#'
    <cfelse>
    NULL
    </cfif>
    , Open_Date=
    <cfif IsDefined("FORM.Open_Date") AND FORM.Open_Date NEQ "">
    '#FORM.Open_Date#'
    <cfelse>
    NULL
    </cfif>
    , Min_Spent=
    <cfif IsDefined("FORM.Min_Spent") AND FORM.Min_Spent NEQ "">
    '#FORM.Min_Spent#'
    <cfelse>
    NULL
    </cfif>
    , OIT_Time_Spent=
    <cfif IsDefined("FORM.OIT_Time_Spent") AND FORM.OIT_Time_Spent NEQ "">
    '#FORM.OIT_Time_Spent#'
    <cfelse>
    NULL
    </cfif>
    , Close_Date=
    <cfif IsDefined("FORM.Close_Date") AND FORM.Close_Date NEQ "">
    '#FORM.Close_Date#'
    <cfelse>
    NULL
    </cfif>
    , Description=
    <cfif IsDefined("FORM.Description") AND FORM.Description NEQ "">
    '#FORM.Description#'
    <cfelse>
    NULL
    </cfif>
    , Solution=
    <cfif IsDefined("FORM.Solution") AND FORM.Solution NEQ "">
    '#FORM.Solution#'
    <cfelse>
    NULL
    </cfif>
    , Type=
    <cfif IsDefined("FORM.Type") AND FORM.Type NEQ "">
    '#FORM.Type#'
    <cfelse>
    NULL
    </cfif>
    , Category=
    <cfif IsDefined("FORM.Category") AND FORM.Category NEQ "">
    '#FORM.Category#'
    <cfelse>
    NULL
    </cfif>
    WHERE Ticket_Num=#form.Ticket_Num#
    </cfquery>
    <cflocation url="editticketaction.cfm">
    </cfif>
    
    <cfquery name="Recordset1" datasource="" username="" password="">
    SELECT *
    FROM v_helpdeskfindnames
    WHERE v_helpdeskfindnames.Ticket_Num LIKE '#url.Ticket_Num#'
    </cfquery>
    
    
    	
    <cfoutput>	
    <form method="post" name="form1" action="#CurrentPage#">
    <input type="text" name="Summary" value="#Recordset1.Summary#" size="32">
    
    <select name="Priority" required="yes">
    <option value="High" <cfif Recordset1.Priority EQ "High">selected="selected"</cfif>>High</option>
    <option value="Medium" <cfif Recordset1.Priority EQ "Medium">selected="selected"</cfif>>Medium</option>
    <option value="Low" <cfif Recordset1.Priority EQ "Low">selected="selected"</cfif>>Low</option>
    </select>
    
    
    <select name="Category">
    <cfloop query="Recordset3">
    	<option value="#Category#" <cfif Recordset1.Category EQ Category>selected="selected"</cfif>>#Recordset3.Category#</option>
    </cfloop>
    </select>
    
    <!--- I have added these 5 form fields --->
    <input type="text" name="Requestor" value="#Recordset1.Requestor#">
    <input type="text" name="OIT_Staff" value="#Recordset1.OIT_Staff#">
    <input type="text" name="Open_Date" value="#DateFormat(Recordset1.Open_Date, 'mm/dd/yyyy')#" size="32">
    <input type="text" name="Type" value="#Recordset1.Type#">
    <input type="text" name="Ticket_num" value="#Recordset1.Ticket_num#">
    	
    <input type="text" name="Min_Spent" value="#Recordset1.Min_Spent#" size="5">
    <input type="text" name="Close_Date" value="#DateFormat(Recordset1.Close_Date, 'mm/dd/yyyy')#" size="32">
    <input type="text" name="OIT_Time_Spent" value="#Recordset1.OIT_Time_Spent#" size="5"> 
    <textarea name="Description" cols="40" rows="8">#Recordset1.Description#</textarea>
    <textarea name="Solution" cols="40" rows="8">#Recordset1.Solution#</textarea>
    
    <input type="submit" value="Update record">
    
    <input type="hidden" name="MM_UpdateRecord" value="form1">
    
    </form>
    </cfoutput>	
    

     

     

     

     

     

     

    Participating Frequently
    May 4, 2020

    Closed Thank you

    WolfShade
    Legend
    May 1, 2020

    You can tell it was written a long time ago.. font, strong, and other tags that have been deprecated from HTML a while ago.

     

    BTW, the code action="<cfoutput>#CurrentPage#</cfoutput>" can be removed.  If the action is left blank, the default is to submit to itself.

     

    But, yeah, I agree with Charlie on this one.. I looked through the form and did not find one single form element named REQUESTOR.  I just assumed that this was your issue.  And, as Charlie stated, if it isn't used anymore you can remove it from the processing portion of code.  If it _is_ needed, then put it back and it should work.

     

    HTH,

     

    ^ _ ^

    Participating Frequently
    May 1, 2020

    I see you reference FORM.Requestor, which I assume is where the error is occuring, but at the top you have a query named "Requestor", that you do not seem to reference anywhere, that will be replacing any "Requestor" variable from the form.

     

    Charlie Arehart
    Community Expert
    Community Expert
    May 1, 2020

    That's an interesting observation, John. But note first that his reference to the requestor var is indeed prefixed with form., so even if they WERE using that query called requestor, it would work (as long as they were careful), but you're right that it could be confusing (to CF or a reader of the code).

     

    But I don't even see that the code is showing ANY field called requestor in the form. I'd think that was the real problem.

     

    jbulldog13, I know you said you are "just taking over" for someone, but I don't see how this could ever have worked. You leave open the possiblity that someone may have changed it since it worked yesterday. If you confirm the file has a date modified date since then, it seems someone removed the field that this code expects to reference. (And maybe it's that you can remove the reference to the field, if it's no longer needed.)

     

    It may help for us to know: is this a situation where the person who left was the only CFML developer? And are you or others not needing to "fix things" even when you may not really be familiar with CFML? If so, this could be a slog for you, with one such challenge after another. But this community is one place to get help, and there are others. I point to them here: https://www.cf411.com/cfhelp. Hope the transition goes smoothly for you.

    /Charlie (troubleshooter, carehart. org)
    Participating Frequently
    May 1, 2020

    You are correct Charlie, I should have read through one more time before replying.