Adding HTML code on a form

  • Profile Image
    DYMprestamos
    Asked on May 23, 2016 at 07:12 PM

    Hi,

    I created this form https://form.jotformz.com/61437249488669 to try to test a feature that I need.

    I currently have forms where I ask customers for their information. Then when they submitt the form it takes them to a page where I have placed a payment button.

    What I would like to do is paste the HTML code for the payment to be made in the form itself (as you can see on the above form is at the very bottom).

    The code that I use is this one:

     

    <a mp-mode="dftl" target="_blank" href="https://www.mercadopago.com/mla/checkout/start?pref_id=86308974-e0bc0072-41ec-4d75-9821-977628b8d870" rel="nofollow noopener" name="MP-payButton" class='blue-ar-l-rn-none'>Pagar</a>
    <script type="text/javascript">
    (function(){function $MPC_load(){window.$MPC_loaded !== true && (function(){var s = document.createElement("script");s.type = "text/javascript";s.async = true;s.src = document.location.protocol+"//secure.mlstatic.com/mptools/render.js";var x = document.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);window.$MPC_loaded = true;})();}window.$MPC_loaded !== true ? (window.attachEvent ?window.attachEvent('onload', $MPC_load) : window.addEventListener('load', $MPC_load, false)) : null;})();
    </script>

     

    Its there a way I can have everything inside one form to simplify the payment process for my customers and make it more user friendly?

     

  • Profile Image
    jonathan
    Answered on May 23, 2016 at 10:39 PM

    It is possible to embed html codes on the form using the TEXT field (found in Basic Fields)

     

     

    But if your codes include script codes then it will not work.

    The script codes will be filtered and removed. This is to due to security measure the form have to prevent XSS injection.

    https://en.wikipedia.org/wiki/Cross-site_scripting

    I see in your provided html code that it includes script. So that will not work for this. 

    You will need to add your scipt code outside the form if you want to use it. Perhaps you have your own website page where you can place your script code instead.

    Hope this help. Let us know if you need further assistance.