Solved

CF - Multiple email form submit

Posted on 2011-03-15
6
322 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
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.

 

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

816 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

13 Experts available now in Live!

Get 1:1 Help Now