SOLVED

Re: Stay on Same Page Form Submits

Go to solution
Anonymous
Not applicable

Stay on Same Page Form Submits

I looked for similar discussions and was unable to find anything. I figured this would be a popular ask for forms 2.0

On form submission, can I make the submitter stay on the same page, but just display a message after submit, such as thank you. Basically as if the form was submitted via AJAX.

Thanks.
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Valerie_Armstro
Level 10 - Champion Alumni

Re: Stay on Same Page Form Submits

Hi Eric,

There is an example of the JavaScript you will need to use in order to achieve this on the Marketo Developers site. 

Example 1 - Hide the form after successful submission.  Does not take the visitor to the follow up p...

View solution in original post

12 REPLIES 12
Valerie_Armstro
Level 10 - Champion Alumni

Re: Stay on Same Page Form Submits

Hi Eric,

There is an example of the JavaScript you will need to use in order to achieve this on the Marketo Developers site. 

Example 1 - Hide the form after successful submission.  Does not take the visitor to the follow up p...

Anonymous
Not applicable

Re: Stay on Same Page Form Submits

thanks! exactly what I was looking for.

Jim_DiModica
Level 3

Re: Stay on Same Page Form Submits

Valerie -

The script works for me, but I need a little more. I need for a confirmation to be revealed when the form hides. The form is in a table cell. I tried making a GIF saying "Thank You" as the cell's background image, but it's not covered by the form. The GIF is visible along with the form. How can I display a confirmation where the form was?

Thanks!

SanfordWhiteman
Level 10 - Community Moderator

Re: Stay on Same Page Form Submits

Jim, sounds like ultimately a CSS issue. If you want to reveal on hide, you have to get positioning and z-order right. Pleas post a link to your page.

Jim_DiModica
Level 3

Re: Stay on Same Page Form Submits

Hi Sanford -

Because the contest started yesterday I had to go with separate form and confirmation pages. I am interested in a resolution, and appreciate your looking into this so I posted the important portion of the code here. It's a test form, so if you need to submit it, please feel free.

Thanks, and happy holidays!

Jim

SanfordWhiteman
Level 10 - Community Moderator

Re: Stay on Same Page Form Submits

For that particular design, you were just missing a background color on the form:

.mktoForm {

    background-color: white;

}

(+ match the TD background color)

Jim_DiModica
Level 3

Re: Stay on Same Page Form Submits

Absolutely worked! Tip of the hat to you, Sanford.

Anonymous
Not applicable

Re: Stay on Same Page Form Submits

This is the link to example form Val mentioned:
http://developers.marketo.com/assets/Forms2DevExamples/example1.html
Anonymous
Not applicable

Re: Stay on Same Page Form Submits

A copy, just in case that example ever dies: Marketo Forms 2.0 Example 1 - JSFiddle