School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,139 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,778 people online right now. Registration is fast and FREE... Join Now!




Coldfusion Flash Form

 

Coldfusion Flash Form, <CFINPUT Type="submit"> Database error

michael.titmuss

22 Oct, 2009 - 12:06 PM
Post #1

New D.I.C Head
*

Joined: 22 Oct, 2009
Posts: 1

O'k this is my problem Coldfusion fans, When changing the Form into FORMAT="Flash" I get problems updating the database when submitted.

but when using the <cfinput type="submit" name="submit" value="update">

The name attribute is required. But when submitted it displays an error saying basically that the submit attribute is unknown in the table and thats because their is no submit col in the table - here the code.

update page:

CODE



<cfquery datasource="learning" name="MovieUpdate">

SELECT MovieID, MovieTitle, image, MovieDesc
FROM Movies
WHERE MovieID=#URL.MovieID#


</cfquery>


<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<link rel="stylesheet" type="text/css" href="../../template/product_list.css">
<link rel="stylesheet" type="text/css" href="../../troop/style.css">
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>

<body>

<cfinclude template="../../troop/header.cfm"><br />



<div id="outerContainer">



<cfset submit = ("Form.Submit")>
  
  
<cfform  format="flash" action="../../flashdump.cfm" method="post" preservedata="yes" >  <table width="90%" border="0" cellspacing="5" cellpadding="5">


  <tr>
    <td>Movie Title</td>
    <td><cfinput type="hidden" name="MovieID" value="#MovieUpdate.MovieID#"></td>
  </tr>
  <tr>
  
  <tr>
    <td>Movie Title</td>
    <td><cfinput type="text" name="MovieTitle" value="#MovieUpdate.MovieTitle#" size="90"></td>
  </tr>
  <tr>
    <td>Movie Image</td>
    <td><cfinput type="text" name="image" value="#MovieUpdate.image#" size="90"></td>
  </tr>
  <tr>
    <td>Movie Description</td>
    
    <td><cftextarea name="MovieDesc" cols="88" rows="3" value="#MovieUpdate.Moviedesc#" ></cftextarea></td>
  </tr>
  <tr>
    <td> </td>
    <td><label>
      <cfinput type="submit" name="submit"  value="submit">
   ></td>
  </tr>
</table>


</cfform>

  
</div>

  


<cfinclude template="../../troop/footer.cfm">
</body>
</html>





and the Processing page:
CODE


<cfupdate datasource="learning" tablename="movies">




<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<link rel="stylesheet" type="text/css" href="../../template/product_list.css">
<link rel="stylesheet" type="text/css" href="../../troop/style.css">
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>

<body>

<cfinclude template="../../troop/header.cfm"><br />




<div id="outerContainer">



  <div align="center">
    
    
    <cfoutput><span class="Title">#FORM.MovieTitle# and this has been successfully Updated in our Database. Thankyou <a href="../index.cfm">Return</a></span></cfoutput> </div>
</div>

  


<cfinclude template="../../troop/footer.cfm">
</body>
</html>




What do I need to do, Im totally stumped and would really use the help!

Thanks for reading.


User is offlineProfile CardPM
+Quote Post


xheartonfire43x

RE: Coldfusion Flash Form

25 Oct, 2009 - 10:08 AM
Post #2

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 267



Thanked: 2 times
My Contributions
QUOTE(michael.titmuss @ 22 Oct, 2009 - 12:06 PM) *

O'k this is my problem Coldfusion fans, When changing the Form into FORMAT="Flash" I get problems updating the database when submitted.

but when using the <cfinput type="submit" name="submit" value="update">

The name attribute is required. But when submitted it displays an error saying basically that the submit attribute is unknown in the table and thats because their is no submit col in the table - here the code.

update page:

CODE



<cfquery datasource="learning" name="MovieUpdate">

SELECT MovieID, MovieTitle, image, MovieDesc
FROM Movies
WHERE MovieID=#URL.MovieID#


</cfquery>


<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<link rel="stylesheet" type="text/css" href="../../template/product_list.css">
<link rel="stylesheet" type="text/css" href="../../troop/style.css">
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>

<body>

<cfinclude template="../../troop/header.cfm"><br />



<div id="outerContainer">



<cfset submit = ("Form.Submit")>
  
  
<cfform  format="flash" action="../../flashdump.cfm" method="post" preservedata="yes" >  <table width="90%" border="0" cellspacing="5" cellpadding="5">


  <tr>
    <td>Movie Title</td>
    <td><cfinput type="hidden" name="MovieID" value="#MovieUpdate.MovieID#"></td>
  </tr>
  <tr>
  
  <tr>
    <td>Movie Title</td>
    <td><cfinput type="text" name="MovieTitle" value="#MovieUpdate.MovieTitle#" size="90"></td>
  </tr>
  <tr>
    <td>Movie Image</td>
    <td><cfinput type="text" name="image" value="#MovieUpdate.image#" size="90"></td>
  </tr>
  <tr>
    <td>Movie Description</td>
    
    <td><cftextarea name="MovieDesc" cols="88" rows="3" value="#MovieUpdate.Moviedesc#" ></cftextarea></td>
  </tr>
  <tr>
    <td> </td>
    <td><label>
      <cfinput type="submit" name="submit"  value="submit">
   ></td>
  </tr>
</table>


</cfform>

  
</div>

  


<cfinclude template="../../troop/footer.cfm">
</body>
</html>





and the Processing page:
CODE


<cfupdate datasource="learning" tablename="movies">




<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<link rel="stylesheet" type="text/css" href="../../template/product_list.css">
<link rel="stylesheet" type="text/css" href="../../troop/style.css">
<!-- TemplateBeginEditable name="head" --><!-- TemplateEndEditable -->
</head>

<body>

<cfinclude template="../../troop/header.cfm"><br />




<div id="outerContainer">



  <div align="center">
    
    
    <cfoutput><span class="Title">#FORM.MovieTitle# and this has been successfully Updated in our Database. Thankyou <a href="../index.cfm">Return</a></span></cfoutput> </div>
</div>

  


<cfinclude template="../../troop/footer.cfm">
</body>
</html>




What do I need to do, Im totally stumped and would really use the help!

Thanks for reading.


Rather than using a cfupdate tag use a cfquery tag and actually do the query update yourself. Using CFQuery is much better anyways, because you can us queryparams will help you guard against SQL Injection.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 03:26PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month