Coldfusion Flash Form

<CFINPUT Type="submit"> Database error

Page 1 of 1

1 Replies - 3044 Views - Last Post: 25 October 2009 - 11:08 AM Rate Topic: -----

#1 michael.titmuss  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-October 09

Coldfusion Flash Form

Post icon  Posted 22 October 2009 - 01: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:



<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:

<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.

Is This A Good Question/Topic? 0
  • +

Replies To: Coldfusion Flash Form

#2 xheartonfire43x  Icon User is offline

  • D.I.C Regular

Reputation: 46
  • View blog
  • Posts: 454
  • Joined: 22-December 08

Re: Coldfusion Flash Form

Posted 25 October 2009 - 11:08 AM

View Postmichael.titmuss, on 22 Oct, 2009 - 12:06 PM, said:

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:



<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:

<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.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1