Ask a Question related to Coldfusion Flash Integration, Design and Development.
-
modernkaos #1
Cannot pass form field variable from Flash form to CFC
hello,
could someone please help me with an issue i'm having....
i'm trying to pass data from flash form fields into my coldfusion component
using a insert into (mysql statement)...
but i can't add any data to my database....
<cfcomponent>
<cffunction name="InsertData" access="remote" returntype="string">
<cfquery datasource="mysql2" name="InsertData">
INSERT INTO newtable2 (NAME_USER, NAME_EMAIL)
VALUES ("#name#", "#email#")
</cfquery>
<cfreturn InsertData>
</cffunction>
</cfcomponent>
and i'm getting the following error...
Variable name is undefined.
my UI Input text field are names: name & email...
i've done all the bindings correctly..(from webservice to input field)
i've set a WSDL URL and operation name
i've added the getURL to my submit button that goes to a CFM
page with the following code...
<cfinvoke webservice="someURL.cfc?wsdl" method="InsertData"
component="mysql.myCFC" returnvariable="InsertData"></cfinvoke>
Am i doing something wrong ?
and that should input the data into the database but it's not...
could someone PLEASE help me with this Data Integration issue...
i just can't figure out why the data won't pass....
I need this to work for a project so any help in the right direction with be
great :)
thank you for all your help in advance
greg carron
flash programmer
[email]greg@kingweb.com[/email]
modernkaos Guest
-
Pass URL Parameter from html form to flash form
In CF, I have a link to a form to update a students attendance; takeattendancehv1.cfm?StudentID=#allstudents.StudentID# . I'm using a flash form in... -
Applying a variable to a form field
Hi there, I have a form on my website which has an option to enter a value in a text box or select a value from a list. What I want it to do is... -
Create a variable using form field
Hello everyone, I am very new to ColdFusion and I am not sure if this is the right place to post this question. I am in the process of buidling... -
how do I pass the FLASH version of the form variable tothe query in CF 7.0
I'm trying to convert a rather long form written in CF 6.1 to CF 7.0. The basics ar this: I built a grid that contains participant names, clicking... -
copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome?
I have a web form with several fields. If I copy & paste from a RTF document into a field, the javascript validation and field length are bypassed... -
aparsons #2
Re: Cannot pass form field variable from Flash form toCFC
function insertUser()
{
checkpasswords();
var dummyVar:String=""; // to handle remoting quirk
// setup args call to insertUser method
var thisUser = {
dsn:"pjas",
username: _root.username.text,
password: _root.password.text,
active: _root.active.value,
school: _root.school.selectedItem.data,
permdesc: _root.permdesc.selectedItem.data,
fname: _root.fname.text,
lname: _root.lname.text,
email: _root.email.text,
phone1: _root.phone1.text
}
<cfoutput>
......
yadayadayada
......
Then in your CFC:
<cffunction name="insertUser" output="false" description="Inserts a new user
into the database" access="remote" returntype="query">
<cfargument name="userArgs" type="struct">
<cfset var addUser = "">
<cfset var lastID="">
<cfset var addUserContact="">
<cfset var GetMyRegion="">
<cfset var addUserRegion="">
<cfset var results="">
<!-- Set the active flag since Flash won't easily change from TRUE to 1-->
<cfif arguments.userArgs.active>
<cfset isActive = 1>
<cfelse>
<cfset isActive=0>
</cfif>
<cftransaction> <!--- missing type of isolation?? --->
<cftry>
<!--- add user --->
<cfquery name="addUser" Datasource="#arguments.userArgs.dsn#">
INSERT INTO user (userid,username,password,active,school_id,perms)
VALUES
(NULL,'#arguments.userArgs.username#','#arguments. userArgs.password#',#isActive#
,#arguments.userArgs.school#,#arguments.userArgs.p ermdesc#)
</cfquery>
......
yadayadayada
......
aparsons Guest
-
PaulH *TMM* #3
Re: Cannot pass form field variable from Flash form to CFC
aparsons wrote:
you're not VARing isActive....this will cause you grief eventually.> <cffunction name="insertUser" output="false" description="Inserts a new user
> into the database" access="remote" returntype="query">
> <cfargument name="userArgs" type="struct">
> <cfset var addUser = "">
> <cfset var lastID="">
> <cfset var addUserContact="">
> <cfset var GetMyRegion="">
> <cfset var addUserRegion="">
> <cfset var results="">
> <!-- Set the active flag since Flash won't easily change from TRUE to 1-->
> <cfif arguments.userArgs.active>
> <cfset isActive = 1>
> <cfelse>
> <cfset isActive=0>
> </cfif>
<cfset var isActive=1>
..
..
..
<cfif NOT arguments.userArgs.active>
<cfset isActive = 0>
</cfif>
PaulH *TMM* Guest



Reply With Quote

