/    Sign up×
Community /Pin to ProfileBookmark

set multiple cookies onsubmit

Hi there

I have a form which submits to a 3rd party (salesforce.com) and returns to a thanks page. There are no values returned at this point.

I would like for that form to write all its contents to cookies when the form is submitted, so that they may be accessed on the thanks page.

How do I do this?

Many thanks!

Austen.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@chucknutJan 10.2008 — Hello...

Depending on what you are developing in, I think the concept is the same as what I had to do. (And probably a long, less efficient way...)

Form Page -> Processing Page -> Thank You Page

On the form page keep all the form element names but change the action to action="form2.asp" (process) page (or whatever). This is the page it submits to...

On this process page take the form information and make variables.

i.e. First_Name = Request.Form("First_Name")

And do this for all the form elements from the form.

Use these variables and this page for what ever... writing cookies, creating e-mail, inserting into another database... as long as you have the form info captured into variables, you can do whatever you want on the process page.

THEN create in the body all hidden form elements and make the "value" the dynamic language variables.

i.e. <input id="first_name" name="first_name" type="hidden" value="<%=First_Name%>">

Make sure that all the info like the return page, Salesforce ID, and other elements needed are on this page.

THEN in the body tag of the process page, throw in an onLoad="register.submit()" JavaScript.

The process page body can be blank or have an animated gif that says, "processing..." so whatever suits your website.

And BECAUSE the second form (all hidden elements) is set to submit to Salesforce (action="http://www.salesforce.com/...") it will then bounce through the Salesforce servlet to your Thank You page.

The concept is just having a process page in the middle, then submitting to Salesforce on the other side, ending on the Thank You page.
×

Success!

Help @austenozzy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...