Cannot pass form field variable from Flash form to CFC

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default Re: Cannot pass form field variable from Flash form to CFC

    aparsons wrote:
    > <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>
    you're not VARing isActive....this will cause you grief eventually.

    <cfset var isActive=1>
    ..
    ..
    ..
    <cfif NOT arguments.userArgs.active>
    <cfset isActive = 0>
    </cfif>

    PaulH *TMM* Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139