| | |
A shortcut for submit twice?
Please support our ColdFusion advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2008
Posts: 5
Reputation:
Solved Threads: 0
Hi guys!
I need your help!
The next script is a normal “insert page” which get back the “GENERATED_KEY”: “myid” and put it hidden form:”myid”.
If the value of “myid” is numeric then the action attribute of “form1” get a page address as value.
The issue is, it shows 2 times the insert page. You have to push 2 times the “submit” button to receive the desired page.
Is it a way to shortcut these repetitive submit?
I need your help!
The next script is a normal “insert page” which get back the “GENERATED_KEY”: “myid” and put it hidden form:”myid”.
If the value of “myid” is numeric then the action attribute of “form1” get a page address as value.
The issue is, it shows 2 times the insert page. You have to push 2 times the “submit” button to receive the desired page.
Is it a way to shortcut these repetitive submit?
coldfusion Syntax (Toggle Plain Text)
<cfparam name="email" default=""> <cfparam name="lname" default=""> <cfparam name="fname" default=""> <cfparam name="myAdress" default=""> <cfparam name="myid" default=""> <cfif isNumeric("#myid#")> <cfset myAdress ="workform.cfm"> <cfelse> <cfif isDefined("form.email")> <cfquery datasource="myData" result="myid"> INSERT INTO myTable (email, lname, fname) VALUES ('#form.email#', '#form.lnume#', '#form.fname#') </cfquery> <cfset #form.myid#="#myid.GENERATED_KEY#"> <cfdump label="Result Structrure" var="#form#"/> </cfif> </cfif> <!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-2" /> <title>Register</title> </head> <body> <cfform name="form1" id="form1" method="post" preservedata="yes" action="#myAdress#"> </p> <p> <label for="email">Email:</label> <cfinput type="text" name="email" id="email"> </p> <p> <label for="lname">Last name:</label> <cfinput type="text" name="lname" id="lname"> </p> <p> <label for="fname">First name</label> <cfinput type="text" name="fname" id="fname"> </p> <p> <cfinput type="hidden" name="myid"> <cfinput type="submit" name="submit" id="submit" value="OK!"> </p> </cfform> <p> </p> </body> </html>
Last edited by peter_budo; Aug 4th, 2008 at 5:30 pm. Reason: Keep It Organized - please use [code] tags
![]() |
Similar Threads
- paging related i have got this error Warning: mysql_fetch_array(): supplied argument (PHP)
- paging related (PHP)
- Slow IE7 startup HJT log included (Viruses, Spyware and other Nasties)
- Variable scope problem (C++)
- can`t open more than one window of internet explorer (Web Browsers)
- IE redirect and pop ups on laptop (Viruses, Spyware and other Nasties)
- insert database (ColdFusion)
- Hotoffers get me mad !! (Viruses, Spyware and other Nasties)
- Persistent spyware problems, HJT log included. (Viruses, Spyware and other Nasties)
- HijackThis shows 01 entries - can't remove (Viruses, Spyware and other Nasties)
Other Threads in the ColdFusion Forum
- Previous Thread: CFLoop Display query results
- Next Thread: Dreamweaver email forms
| Thread Tools | Search this Thread |





