All, 
 
I am new to CF, and have inherited a pretty complex application from
someone who left my company. One of my first tasks is to create a
tracker which will allow users to track the reason, duration, and
severity of issues they log out of a queue to support.
 
Being new as I am, I'm pretty proud of my work, since this is my first
start-to-finish app, but for what I'm sure is a very simple reason, the
variables aren't being passed to SQL. Well, not all the variables, just
the ones which are supposed to be defined by the forms.
 
My guess is I'm doing something simple wrong, and you will all laugh at
me, and I'm ok with that.
 
Here is what I've done:
 
-----------------------
 
<cfquery datasource="mmsdata" name="reason">
SELECT reason, work_id
FROM tbl_MMSDATA_workid
</cfquery>
 
<cfquery datasource="mmsdata" name="length">
SELECT length, duration_id
FROM tbl_MMSDATA_durid
</cfquery>
 
<cfquery datasource="mmsdata" name="severity">
SELECT severity, sev_id
FROM tbl_MMSDATA_sevid
</cfquery>
 
<CFQUERY DATASOURCE="mmsdata">
  INSERT INTO dbo.tbl_MMSDATA_work (submitter,
           work_id,
         duration_id,
         sev_id)
  VALUES (  <cfif IsDefined("SESSION.cuid")>'#SESSION.cuid#'</cfif>,
     <cfif IsDefined("FORM.reason")>#FORM.reason#</cfif>,
   <cfif IsDefined("FORM.length")>#FORM.length#</cfif>,
   <cfif IsDefined("FORM.severity")>#FORM.severity#</cfif>
   );
</cfquery>
 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>What exactly is it you do here?</title>
<style type="text/css">
 
..style3 {font-family: Arial, Helvetica, sans-serif; color: #FFFFFF; }
..style4 {
 color: #FFFFFF;
 font-style: italic;
}
 
</style>
 
<script language="javascript">
 
</script>
 
</head>
 
<body bgcolor="#990033">
<table width="400"  border="0" align="center" cellpadding="0">
  <tr>
    <th scope="col"><span class="style3">Auto-In Work Type</span></th>
    <th scope="col"><span class="style3">Duration</span></th>
    <th scope="col"><span class="style3">Urgency</span></th>
  </tr>
  <tr>
    <td valign="middle"><div align="center"> <FORM method="post"
name="reason">
  <SELECT ONCLICK="ExpireSession();" NAME="reason">
  <option value="Undefined">- Choose -</option>
        <cfoutput query="reason">
          <option value="#reason.work_id#">#reason.reason#</option>
        </cfoutput>
      </select></FORM>
    </div></td>
    <td valign="middle">
      <div align="center"> <FORM method="post" name="length">
   <SELECT ONCLICK="ExpireSession();" NAME="length">
        <option value="Undefined">- Choose -</option>
        <cfoutput query="length">
          <option value="#length.duration_id#">#length.length#</option>
        </cfoutput>
      </select></FORM>
      </div>
    </td>
    <td valign="middle">
      <div align="center"> <form method="post" name="severity">
   <SELECT ONCLICK="ExpireSession();" NAME="severity">
        <option value="Undefined">- Choose -</option>
        <cfoutput query="severity">
          <option value="#severity.sev_id#">#severity.severity#</option>
        </cfoutput>
      </select></form>
      </div>
    </td>
  </tr>
  <tr>
    <td colspan="3"><form name="form3" method="post"
action="http://st-mmsapps/EDIT/work.cfm";>
      <div align="right">
        <input type="submit" name="Submit" value="Submit" onClick="">
</div>
    </form></td>
  </tr>
</table>
<p align="center"><img src="img/thebobs.bmp"></p>
<p align="center" class="style4">Thanks,<BR>
The Bobs</p>
</body>

 
------------------
 
When I view the error message what end up happening is the actual SQL
INSERT statement being passed is:
 
INSERT INTO dbo.tbl_MMSDATA_work (submitter, work_id, duration_id,
sev_id) VALUES ( 'jr6115', , , ); 
 
So variables reason, duration, and severity aren't being passed to the
INSERT.
 
I apologize in advance if this is discussed at length in CFWACK, but
I've poured over the chapter on FORMS and couldn't find anything that
felt contextually correct.
 
Any help you can provide in this regard is greatly appreciated.
 
Thanks.
 
Michael Carpenter



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1463
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to