Inserting data with flash forms

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

  1. #1

    Default 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

  2. Similar Questions and Discussions

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

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

  7. #6

    Default 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

  8. #7

    Default 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

  9. #8

    Default 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

  10. #9

    Default Re: Inserting data with flash forms

    You are welcome! Thanks again for you help.
    gendrall 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