Skip to main content
Inspiring
September 13, 2006
Question

using cfform to interact with databases

  • September 13, 2006
  • 1 reply
  • 300 views
hi there, I am just trying to get ito using the cfform tag, and I thought it would be as easy to do insert into table ect using server behaviours, but clearly not! could somebody point me the right direction of some good tutorials please, to show me how to do all the wonderful interaction with Databases that I have been able to do with normal dreamweaver html forms...

Many thanks
    This topic has been closed for replies.

    1 reply

    Inspiring
    September 13, 2006
    You have two options here:
    1. Submit the form to a processing page where you have something like this:
    <cfquery name="queryTest" datasouce="mydb">
    INSERT INTO myTable
    etc...
    </cfquery>
    2. Using Flash Remoting, using Actionscript and cfc's.

    If using option 1, your <cfform> tag needs to include the ACTION parameter, and if necessary, the TARGET parameter. E.g. <cfform name="myForm" ACTION="processing_page.cfm" Target="hidden">. When I use option 1, which is rare at this point, I like to submit the page to a hidden frame, and then use a body onload url once the processing page finished to navigate the user to the next page. If you do this, make sure you prevent the user from submitting the form again by disabling the submit button using the mousedown or mouseup events.