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

    Conditional thank you url redirect with different onclick events ?

    Asked by mbam on January 17, 2014 at 11:04 AM

    Hello,

    I need to use the "Redirect to a different thank you page according to the form submission" but with the use of different onclick or onsubmit functions.

    <a target="_blank" href="#" onclick="addMembershipToCart('MEMBER-GIFT-1-709');">

    Where or how can I insert them ? I only get a url field with no other options ?

    Even when I look at the embed source code I can't find where I can edit my conditional submit url ?

    Please help ! :)

    Alex

    different source find hello
  • Profile Image

    Answered by EliezerN on January 17, 2014 at 12:10 PM

    If you need to add some kind of code/script to your form to accomplish what you need, the only way to insert that code is by getting the form source code and inserting your code/script to it. Here is how to get your form source code: How to get your form source code

    After adding your code/script just embed the form source code to the desired webpage.

    Please inform us if you need further assistance with this inquiry or kindly open new threads for unrelated questions.

    Thanks

  • Profile Image

    Answered by mbam on January 17, 2014 at 02:15 PM

    Hello,

    Thank you for your answer and yes please, I need further assistance.

    I can't find in any of the downloaded source code (.js or .html) my conditional redirection url to tweak.

    Where in the source files can I find my redirection url so I can add my OnSubmit javascript event ?

    I did download the .zip package with the refined css/js/html.

    Thank you,

    Alex

  • Profile Image
    JotForm Support

    Answered by jonathan on January 17, 2014 at 03:17 PM

    Hi Alex,

    Using the guide -How-to-get-your-Form-Source-Code  provided by our colleague ElizerN, you can download the .js and html file as mentioned below

    --------------------

    If you'd like to host the form files to your own server, you can download a compressed and refined version of the form with its separate CSS and JS files by clicking the "here" link from the Form Embed Wizard.

     

    you need the click on the "here" link in the guide.

    Hope this help. Inform us if you are still not able to do this.

    Thanks.

  • Profile Image

    Answered by mbam on January 17, 2014 at 03:30 PM

    Hello,

    Please read again my last answer. I have downloaded the .zip using the "here" link.

    I also have searched all the provided files for my redirection link with no success.

    Now please if you can answer my question :

    Where in those source files can I find my conditional redirection url so I can add my OnSubmit javascript event ?

    Thank you in advance, please no more generic answer.

    Alex

  • Profile Image
    JotForm Support

    Answered by jonathan on January 17, 2014 at 04:08 PM

    Hi Alex,

    Thank you for explaining that more clearly. I apologize for missing the specifics on the initial response.

    Where in those source files can I find my conditional redirection url so I can add my OnSubmit javascript event ?

    Unfortunately, you cannot see in the source code the redirection event's code for this. Because this is part of the application's PHP code, which is triggered only on the back end. Meaning, that redirection is server side.

    BUT, you can still add your own OnSubmit javascript event using the form's source code. You will just have to make sure this is triggered on the form's submit action.

     

    If you are referring to this form https://www.jotform.com/40164180318952 you can already see the javascript code of the setcondition logic

     

    Inform us if you need further assistance.

    Thanks.