A while back I ran into an issue when working to integrate a set of self hosted Eloqua forms on our site. The issue was compounded by two main items.
1) The forms in question existed or could be presented on almost any page on the site via an ajax modal.
2) All of the forms on the site post to a central object for validation and are then submitted from a secondary page/function.
These two items caused the form to lose the vital Eloqua cookie information which helps to reduce duplicate data and other unpleasantries. And trust me, no one wants to see a form toss it’s cookies.
As it turns out, I was not the only one having this issue. After a bit of research I found this article on the Eloqua Artisan (http://eloqua.blogspot.com/2010/03/using-form-reposts-for-advanced-form.html) blog that was most helpful in crafting a solution. I would also like to mention that Steve Woods of Eloqua was very helpful in his fast responses to my questions about the blog post.
The challenge was to take the ideas from this article and apply them to our specific need. Here is the approach that I took.
Step 1. Create 2 form elements on each form to hold the required information:
<input type="hidden" name="elqCustomerGUID" id="elqCustomerGUID" value="" /> <input type="hidden" name="elqCookieWrite" id="elqCookieWrite" value="0" />
The second element “elqCookieWrite” should always pass a value of 0, the first element will eventually hold the cookie value.
Now when the form is presented on the page, this code will use the Eloqua function and pass it to our central form processing object. Doing this allows the form to behave as if it directly posted to Eloqua, but this way you will maintain complete control of all of the form processing steps, including the user experience.