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

    How to set up a 'Paypal field' combined with conditions

    Asked by a2034487 on January 23, 2014 at 09:50 AM

    Hi,

    we're trying to set up a form that contains (amongst others) a selection field and a paypal field. 

    The user will firstly choose the name of the doctor he wishes to see. Then, based on this selection, we wish to show a paypal field that shows only those treatments that are proposed by the selected doctor.

    The first part of this, having a field shown or hidden based on a selection, that we have done. However we thought that the solution was to include multiple paypal fields (and have the correct field with the correct treatments shown automatically).

    However, there is only one paypal field possible.

    So the question: how do we give the visitor the choice of ONLY the treatments based on  the choice of doctor ?

     

    Thanks for your help !

    Page URL:
    http://www.jotform.com/?formID=40221549487962

    name hidden Selection selected
  • Profile Image
    JotForm Support

    Answered by EltonCris on January 23, 2014 at 10:17 AM

    Hi,

    Sorry but there is no direct solution to that. A workaround is to create multiple payment forms with each of them has the defined treatments (products). And then embed these forms to another clean form containing only a dropdown field to do the hide/show conditions. This is similar to the idea on this guide: www.jotform.com/help/182-How-to-Create-a-Basic-Multiple-Payment-form

    Let us know if you have further questions or if you need further clarification about this.

    Regards!

  • Profile Image

    Answered by a2034487 on January 24, 2014 at 05:11 AM

    Hi,

    thanks for your answer. I've set it up as in your guide, but for some reason the script embed code for the separate forms keeps disappearing... 

    Regards,

  • Profile Image

    Answered by jedcadorna on January 24, 2014 at 08:22 AM

    Hello,

    Yes the <script> portion is being stripped off due to security reason this is to sanitize the field so it won't allow any malicous code embedded into it. You can use the iFrame code instead of the ordinary embed code. With iframe the <script> tag will automatically be removed when you apply the changes leaving the <iframe></iframe> code.

    Let us know if you are still having problem applying this changes to your form so we could help you.

  • Profile Image

    Answered by a2034487 on January 24, 2014 at 08:48 AM

    I'm sorry, I don't quite understand what you mean by 'leaving the iframe' codes

    I've tried replacing the <script> with <iframe> and </iframe>, but as soon as I save this, it is replaced with a small window containing a lot of code:

    /*jslint nomen:false, debug:true, evil:true, vars:false, browser:true, forin:true, undef:false, white:false */

    /**

     * Includes a Form with javascript

     * @param {Object} formId

     * @param {Object} initialHeight

     * @param {Object} iframeCode

     */

    function FrameBuilder (formId, appendTo, initialHeight, iframeCode){

        this.formId = formId;

        this.initialHeight = initialHeight;

        this.iframeCode = iframeCode;

        this.frame = null;

     

    and 15 more pages like this...

     

    In my original code I'm trying to insert, there is no Iframe at all:

     

    <script type="text/javascript" src="//form.jotformpro.com/jsform/40232040044939"></script>

     

  • Profile Image

    Answered by jedcadorna on January 24, 2014 at 09:41 AM

    Hello,

    Sorry for not making a clear instruction. You need to get an iframe code instead of using your embed code. Here's a guide on how to get an iframe code: https://www.jotform.com/help/148-How-to-Get-the-iFrame-Code

    Once you have your iframe code paste it on HTML section:

     

    Here's a sample of an iframe code:

    <iframe id="JotFormIFrame" onload="window.parent.scrollTo(0,0)" allowtransparency="true" src="//form.jotformpro.com/form/40232040044939" frameborder="0" style="width:100%; height:465px; border:none;" scrolling="no"></iframe>

    <script type="text/javascript">window.handleIFrameMessage = function(e) {var args = e.data.split(":");var iframe = document.getElementById("JotFormIFrame");if (!iframe)return;switch (args[0]) {case "scrollIntoView":iframe.scrollIntoView();break;case "setHeight":iframe.style.height = args[1] + "px";break;}};if (window.addEventListener) {window.addEventListener("message", handleIFrameMessage, false);} else if (window.attachEvent) {window.attachEvent("onmessage", handleIFrameMessage);}</script>