What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Submit form without redirect to thank you page

    Asked by guest_22984534720053 on October 26, 2012 at 11:40 AM

    Hi,

    I was wondering if the following is possible:

     

    - The user clicks the submit button on the form

    - The form is submitted via an ajax call to JotForm

    - If the ajax call is successful, the form is hidden and replaced with a thank you message.

     

    I understand that I could potentially achieve something similar by redirecting the user back to the current page and then hiding the form if a URL parameter is present e.g www.example.com/contact?submitted, but I was wondering if there was a more elegant approach?

     

    thanks,

     

    Rob

  • Profile Image
    JotForm Support

    Answered by NeilVicente on October 26, 2012 at 12:43 PM

    Rob,

    Embedding the form using iFrame method and configuring the form to use either the "Default Thank You Page" or "Thank You Message" as opposed to "Custom Thank You URL" should make your goal possible.

    You can add an onLoad trigger to the form's iFrame codes so that upon URL change (submission), a script will load a separate PHP page on the iFrame where the form was initially loaded (which will then set a cookie).

    Now, this cookie will determine whether to display the form on the page or not.

    This purely theoretical solution is a little complicated and may seem like it will work, but I have not tested it yet. I will do some tests to see if it's feasible and will get back to you with the results.