ColdFusion - Using a script to build and execute SQL query when a button is clicked
I am writing a simple page in ColdFusion with a form to add a record to a database. What I want to do though, rather than creating another .cfm page to build and run the SQL INSERT statement, or having the form call the same page and building and executing it as part of a <cfswitch> statement, is this: I would like to write a script that is exectued when the "Submit" button is clicked, and have the script build and execute the SQL statement. Is this possible? If so, how would I do it and in what language? I am really new to CF and CFScript, and don't know how to do it in JavaScript, if it is even possible.
Edit: I would also like to use this script for form validation, if possible.
Last edited by Locura; 12-09-2003 at 12:39 AM.
|