Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
gendrall #1
Inserting data with flash forms
I've been racking my brain for the last 2 days trying to figure out how to do a
simple insert into a database with a Flash form. No matter what I do I can't
get the function to write. I've seen many examples but none work. I've even
tried various code examples in livedocs to stunning error results. Anyway, this
is the code that I'm using on my form:
<cfif IsDefined("form.addInfo") is True>
<!------- Add a resource ------->
<cffunction name="addInfo" output="true" access="public" returntype="boolean"
hint="Add new resources">
<cfargument name="pdf" type="string" required="yes" hint="PDF">
<cfargument name="doc" type="string" required="yes" hint="DOC">
<cfargument name="other" type="string" required="no" hint="other file types">
<cfargument name="Area" type="string" required="yes" hint="Area">
<cfargument name="Category" type="string" required="yes" hint="Category">
<cfargument name="SubCategory" type="string" required="yes" hint="SubCategory">
<cfargument name="ItemNumber" type="string" required="yes" hint="ItemNumber">
<cfargument name="Description" type="string" required="yes" hint="Description">
<cfargument name="modified" type="string" required="yes" hint="modified">
<!------- INSERT INTO THE DEV DATABASE ------->
<cfquery name="Insert" datasource="#ds3#">
INSERT INTO theVaultDev (
pdf,
doc,
other,
Area,
Category,
SubCategory,
ItemNumber,
Description,
modified
)
VALUES (
'#ARGUMENTS.pdf#',
'#ARGUMENTS.doc#',
'#ARGUMENTS.other#',
'#ARGUMENTS.Area#',
'#ARGUMENTS.Category#',
'#ARGUMENTS.SubCategory#',
'#ARGUMENTS.ItemNumber#',
'#ARGUMENTS.Description#',
'1'
)
</cfquery>
<!------- /INSERT INTO THE DEV DATABASE ------->
<cfreturn true>
</cffunction>
</cfif>
What am I doing wrong?
gendrall Guest
-
Flash forms, grid and accessing currently selected data
Hi, I use cfform format flash to display and edit participant information to a sport competition. I have a top panel displaying a grid with the... -
Binding Data From DB to Flash Forms
Hi, I am new in integrating flash forms in Coldfusion.I want to populate the list box or text box with data that is read from the database. For... -
Flash Forms Query Data Validation
I have a Flash Form that asks for an e-mail address. I would like to use client-side data validation within flash forms to check the database to... -
CF7 Flash Forms Data Binding
Is there a good tutorial somewhere on how to bind query data to an input text box in a flash form? I'd like a user to click on the form's next... -
Inserting Photos into Forms
I need my form to allow my photos to be inserted as a bitmap--NOT a package. I have changed the data type of this field to a OLE in my table... -
Johnny Derk #2
Re: Inserting data with flash forms
the value 1 being inserted into modified column probably does not need quotes.
Also why do you have modified argument if you are not using it?
Johnny Derk Guest
-
gendrall #3
Re: Inserting data with flash forms
hmm...interesting...but I removed the '1' value and a few others and nothing
seems to insert. The reason is for the "modified" is that it's a field in the
database for the updates/inserts to designate what's been modified or what is a
new addition to the "grid".
gendrall Guest
-
Johnny Derk #4
Re: Inserting data with flash forms
what values would you be inserting into db. Are some of your values numeric.
Numeric values do not need single quotes.
**Using Quotes** from: [url]http://www.w3schools.com/sql/sql_where.asp[/url]
Note that we have used single quotes around the conditional values in the
examples.
SQL uses single quotes around text values (most database systems will also
accept double quotes). Numeric values should not be enclosed in quotes.
For text values:
This is correct:
SELECT * FROM Persons WHERE FirstName='Tove'This is wrong:
SELECT * FROM Persons WHERE FirstName=Tove
For numeric values:
This is correct:
SELECT * FROM Persons WHERE Year>1965This is wrong:
SELECT * FROM Persons WHERE Year>'1965'
Johnny Derk Guest
-
gendrall #5
Re: Inserting data with flash forms
The modified field is a yes/no field in the database.
I've not had a problem with this query outside using it in the cffunction.
This is the insert that I used on the current HTML form that the client is
using. So I don't think it's the insert query itself, since I tested outside
the cffunction with no problems and it's being used with no problems on the
HTML form.
It's when I have it in the cffunction that the query insert is ignored.
I wish CF had a "cfgridinsert" function like the cfgridupdate and then I would
not be having this problem :-]
gendrall Guest
-
Johnny Derk #6
Re: Inserting data with flash forms
Your question caused me to try my first cfgrid and used it with cfgridupdate- I
was able to insert, delete, and update data with the cfgridupdate tag.
Here was the code I threw together for test purposes:
<!---Cfgrid page---->
<cfquery name="changeinfo" datasource="MyDataSource">
SELECT *
FROM dbo.DBTABLE</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=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<cfform name="insert" action="gridupdat.cfm">
<cfgrid insert="yes" selectmode="edit" delete="yes" query= "changeinfo"
name="change"> </cfgrid>
<cfinput type="submit" name="">
</cfform></body>
Action Page--
<cfgridupdate
grid = "change"
dataSource = "MYDB"
tableName = "MYDBTABLE"
keyonly="yes"Hope this helps>
Johnny Derk Guest
-
gendrall #7
Re: Inserting data with flash forms
SWEET! That did it.
I didn't have the 'name="insert"' in the cfform tag. Once I put that in there, the form worked.
Awesome.
Thank you thank you thank you! Much appreciate your help.
gendrall Guest
-
Johnny Derk #8
Re: Inserting data with flash forms
Thank You for asking the question, because I got to see how incredible cfgrid is. It really is a helpful and powerful tag. I will definately use this in the future
Johnny Derk Guest
-
gendrall #9
Re: Inserting data with flash forms
You are welcome! Thanks again for you help.
gendrall Guest



Reply With Quote

