I need to add a flat fee of $5 to my Purchase Order. How do I prepopulate an amount?

  • Profile Image
    aerwso
    Asked on January 21, 2013 at 09:33 PM
  • Profile Image
    Welvin
    Answered on January 22, 2013 at 03:40 AM

    Hi,

    Do you mean, a flat $5 fee for one category? Let say to this form: http://www.jotform.com/30197451615251, a flat $5 fee for Novice & Jeunes / Kids?

    Please let me know if I misunderstood your question.

    Thanks

  • Profile Image
    aerwso
    Answered on January 22, 2013 at 08:05 AM

    The form is a registration for a horse show, and there is a fee for paperwork added at the end. It is not for each category, but for the entire form.

  • Profile Image
    jonathan
    Answered on January 22, 2013 at 10:00 AM

    @aerwso

    If I understand it correctly, you want to have at least a mandatory amount of $5 within the total.

    Is something similar to this demo form, is what you are after? In this demo, a 1 dozen cupcakes is always selected in the items/products.

    In the demo, it requires using the form's source code, so that additional code function can be injected. If you view the demo form's html source, you will see the javascripts code used at the bottom part.

    Please inform us if this have relevance to what you need.

    Thanks.

  • Profile Image
    aerwso
    Answered on January 22, 2013 at 12:07 PM

    That is what I wanted. How do I inject the java script into the source code?

    Thanks

  • Profile Image
    idarktech
    Answered on January 22, 2013 at 12:26 PM

    Hi,

    As per mentioned by my colleague, you can inject the script that's seen on his demo (page source). Here's how:

    1. First, get your form source code. Follow this guide: How to get your Form Source Code

    2. Add the following script at the most bottom part of your form source code.

     

    <script type="text/javascript">

    (function () {

        var cupcakes12 = document.getElementById("input_14_1008");

        cupcakes12.checked = true;

        $("payment_total").update("5.00");

        // Prevents users from unchecking box

        cupcakes12.onclick = function () {

            cupcakes12.checked = true;

            return false;

        };

    })();

    </script>

    Note that this code only applies to a single product of your form which is the 7 Présentation au licou poney pas & trot / Showmanship walk & trot pony . If you want something else, just let us know here so we can assist you further. Thanks!