Solved

CF - Multiple email form submit

Posted on 2011-03-15
6
320 Views
Last Modified: 2012-05-11
For some reason it has been requested that we have a email signup form that first comes up and asks for your email and after you click submit another form comes up asking for name, company etc.  How do I match up the first form submission with the second so the email submitted matches the name, company etc.

Any help is appreciated
0
Comment
Question by:JohnMac328
  • 3
  • 3
6 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 35141279

Do you want to create a database record for the first page or only after successful submission of both pages?

If saving after each page...
Have the first form submit, save, get the Primary key from the table and pass it to the 2nd form

If saving only after 2nd page...
Have the first form submit to the 2nd page, store those fields in hidden form fields, on submit, save everything


The first method is probably the one you want, it allows you to get some information saved before asking for more.  If the user bails out on the 2nd page, at least you have their basic info.  

0
 

Author Comment

by:JohnMac328
ID: 35141324
Yes - I was thinking of something like the first example.  How do I pass the primary key to the 2nd form?
0
 
LVL 39

Expert Comment

by:gdemaria
ID: 35141378

The first form can post to the second form if you like.  At the top of the form-2's file, just test for the submit action of form-1.   You save the data and then drop down the code to show the 2nd form, putting the ID into a hidden field.

Alternatively, you can pass it on the URL,  After saving the first form, just do a cflocation

<cflocation url="form2.cfm?Id=#theID#" addToken="no">

0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

Author Comment

by:JohnMac328
ID: 35141416
So after the first submit the email will be added with the ID of 400.  With cflocation the remaining data will be entered also under the ID of 400?
0
 
LVL 39

Accepted Solution

by:
gdemaria earned 500 total points
ID: 35141494

 AFter the first submit, the email will be added (inserted, I assume?)
 Get the ID from the newly created record
 Pass the ID to the other form with CFLOCATION

 Now on 2nd form, ask for the information you want
 On submit, update the table using ID=#url.ID#


-------------------------------------------------------------------------
First Form..


  if submit then
     save email
     get ID
     cflocaton form2.cfm?ID=#getID#
  end if

 The Form (submit page to itself)
  What is your Email address [       ]
  [Submit button]




Second Form

  if submit then  
     update record where ID = #url.id#
     cflocation url="goSomewhereElse.cfm"
  end if

 
 The Form (submit page to itself)
   What is your name, phone, etc?
   [Submit button]
0
 

Author Closing Comment

by:JohnMac328
ID: 35141522
That should work.

Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Stored Procedure 2 47
Query Peformance + mulitple query plans 9 48
Linking a DMV to a database id/sql text in SQL server 2008 8 48
Sql query 107 33
CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now