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

    Adding values in form and passing to authorize.net total field

    Asked by biiainsurance on January 14, 2014 at 05:11 PM

    From previous thread .....

    Conditions still need to be met to pass certain values but here goes .... 

    2) Would I be able to export my current form once conditions work correctly to make the "total" field from my form populate the authorize.net "total" field or even just pass it directly using a variable before they hit submit?

    It is most likely that we can do this with the form source code and some custom Javascript. In this case you will need to host the form source by yourself. If you are interested in this, it is most likely that we can help with the custom Javascript, but you will need to create a new forum thread for this.

    http://www.jotform.us/form/40133764614147 

    Thansk in advance!!

    and form source JotForm source create
  • Profile Image
    JotForm Support

    Answered by ardy0689 on January 14, 2014 at 05:43 PM

    Thank you for contacting us. I guess this is the thread http://www.jotform.com/answers/317301-Populate-Payment-Authorize-net-total-field-with-options-from-form#3 where the inquiry came from correct?

    As from what my colleague has already suggested, you need to get the form source code and host it on your server. Then use a custom Javascript to fetch the values and insert in on the total field of the Authorize.net integration.

    However, in order to do that, can you please identify where would the amounts or values would come from or to which fields to be added on the total? Or if you have some kind of formula or your own calculations, you can also give that to us as well. Please do get back to us so that we can assist you further. Thank you

  • Profile Image

    Answered by biiainsurance on January 14, 2014 at 08:39 PM

    Yes that is the correct thread inquiry ....

    I have exported the form and uploaded it to the server here (http://biiainsurance.com/builders-risk-form/)

     

    As for the amounts, the first selection comes from "Is Property Coastal" section .. when the chose an option it shows a different set of radio buttons directly under that section, each one of the radio buttons in the "Is Property Coastal" shows a different set of options, each with different rates. I have typed the rates in with the description for what becomes "Protected Coastal" "UnProtected Coastal" "Protected All Other" "UnProtected All Other" .. Depending on which option they choose on those radio buttons it will become the "Rate" then multiple by the "Estimated Completed Value" field  then divided by 100 to get "Premium Due" which is what should be passed to Auth.net to process payment ...

    (Protected Coastal Option) = Rate 

    Rate * Estimated Completion Value

    Estimated Completion Value / 100

    OR

    (UnProtected Coastal Option) = Rate 

    Rate * Estimated Completion Value

    Estimated Completion Value / 100

    OR

    (Protected All Other Option) = Rate 

    Rate * Estimated Completion Value

    Estimated Completion Value / 100

    OR

    (UnProtected All Other) = Rate 

    Rate * Estimated Completion Value

    Estimated Completion Value / 100

    I hope this makes sense ... seems pretty easy in theory but this thing puts out a lot of code so hope to get a little direction :o) Any help is much appreciated 

    Thanks again

  • Profile Image
    JotForm Support

    Answered by EltonCris on January 15, 2014 at 02:00 AM

    Hi,

    We'll see what we can come up about this. We will update you here once we have the script ready.

    Regards!

  • Profile Image

    Answered by biiainsurance on January 15, 2014 at 10:36 PM

    Would it be easier to just take the "rate" field out or is that no biggie as the variable will be set anyway ? I do not want to do anything to mess up anything you guys are doing ...

    Thanks 

  • Profile Image

    Answered by biiainsurance on January 15, 2014 at 10:55 PM

    also I totally do not mind helping out where I can .... I have gone into the form on the website and changed the "value" of each radio radio button to the rate it should be and I see the javascript in the header. Is there a way for me to change those values in the jotform system so on each export I do not overwrite anything I do on my own server? 

    "

    <script type="text/javascript">

       JotForm.setCalculations([{"decimalPlaces":"2","equation":"{70}*{65}/100","equationText":"{rate}*{estimatedCompletion}/100","operands":"70,65","readOnly":"","resultField":"72","showBeforeInput":"1"},{"decimalPlaces":"2","equation":"[{70}*{65}/100]","equationText":"[{rate}*{estimatedCompletion}/100]","operands":"70,65","readOnly":"1","resultField":"72","showBeforeInput":"1"},{"decimalPlaces":"2","equation":"","equationText":"","operands":"","readOnly":"","resultField":"65","showBeforeInput":"1"}]);</script> 

    "

  • Profile Image

    Answered by Cesar on January 15, 2014 at 11:38 PM

    Unfortunatelly this would be the proper process to customize the radio. Buttons. Nevertheless it would be best to see what Elton will provide to better assist you. Once there is an update on this, you will be notified through this thead. Thank you.

  • Profile Image

    Answered by biiainsurance on January 17, 2014 at 11:27 AM

    Hello,

    I do not mean to be a pain but wanted to see if there was anything that I could do to help out? or if you have had any luck ?

    Thanks agian for all of your help

     

  • Profile Image
    JotForm Support

    Answered by ashwin_d on January 17, 2014 at 12:11 PM

    Hello biiainsurance,

    Unfortunately my colleague "Elton" is not online right now. I am sending him a note and he will get back to you when he is back online.

    Thank you!

  • Profile Image
    JotForm Support

    Answered by EltonCris on January 19, 2014 at 12:04 PM

    @biiainsurance

    Sorry for the latency. Here's the working script for your form. http://pastiebin.com/52dc03917011f

    To apply this script, please take your form source code in the form builder, paste it to notepad or any text editing tools you may have then paste this script under it. The script works as described on your formula so you don't need the calculation script anymore generated from Jotform, in other words, delete the calculation script on your form source code. I a referring to the script that is enclosed with the following:

    <script type="text/javascript">

    JotForm.setCalculations([])

    </script> 

    Demo: https://shots.jotform.com/elton/workaround/calculation_conditions_317385.html

    Feel free to let us know if you find any errors or if there's any mistake on the calculation script.

  • Profile Image

    Answered by biiainsurance on January 19, 2014 at 07:56 PM

    Hey Elton, Thank you so much for sending that over, everything looks great ... I was wondering how the integration with Authorize.net and the payment processing vs. email sent works.

    Does the payment process before the form is sent? Like only if payment is a success ? Wondering as I just did the "test email" and I did not see anything that would tie the form to the payment, like with a confirmation number or anything ... 

    Does that make sense?  Maybe it would be a feature request to where payment processes with the new Authorize.net Direct Post Method ? so it can kick back some kind of number to comfirm payment and for record keeping that would arrive in email as well ?

    Let me know your thoughts when you can ..

  • Profile Image
    JotForm Support

    Answered by EltonCris on January 20, 2014 at 05:07 AM

    @biiainsurance

    Great, glad it works for you.

    When you integrate your form to Authorize.net, it would automatically create a CC fields including the billing info fields just like how it currently appears on the demo. When the user made an actual payment using the form, it will be automatically processed by authorize.net and the payment will be sent directly to your authorize.net account.

    You should make an actual submissions with your form if you'd like to test the authorize.net integration with your form. Clicking the "Test Email" on the notification wizard will just send a test email to your account email address containing all the field variables. In other words, the test email will not process any payments.

    By the way, you can also test your authorize.net form without making an actual payment. Simply enable "Sandbox Mode". Here's a complete guide: How-to-Test-Authorize.net-Payment-Tool-on-Sandbox-Mode

    Hope this information helps. Regards!

  • Profile Image

    Answered by biiainsurance on January 27, 2014 at 09:25 AM

    Hey, this looks great however I now need to add one additinal field and the decimil is in the wrong place for premium due. Is it safe for me to change the form and just copy the script from the one you sent me? Sorry about huge delay ...

  • Profile Image

    Answered by biiainsurance on January 27, 2014 at 09:32 AM

    @Elton ...

    Just an example ...

    Coastal & Protected
    Masonry Non-Comb

    gives a rate of .14

    estimated completion value of say "200000"

    gives a premium of $2800.00 but it should be $280.00

    Auth Payment Info $280.00

  • Profile Image

    Answered by EliezerN on January 27, 2014 at 09:53 AM

    @biiainsurance

    Your messages have been forwarded to my acolleague Elton, so, once he is online it is sure he will reply to you.

    Thanks

  • Profile Image

    Answered by biiainsurance on January 27, 2014 at 10:02 AM

    Thank you EliezerN .... @Elton, I went back in the code and saw where the calculation was dividing by 10 so I changed that to /100 and it appears to be working :o)

    I just didnt want to break anything you had created for me .. Let me know if that was the right step..

     

  • Profile Image
    JotForm Support

    Answered by EltonCris on January 27, 2014 at 10:27 AM

    @biiainsurance

    Yes, that's right! =)

    You can also provide to us the website URL where your final form is embedded so we can help you check it here if the calculation is still not working properly.

    Regards!

  • Profile Image

    Answered by biiainsurance on January 30, 2014 at 05:09 PM

    Hey, not sure if I can/should ask this here but wanted to know how the form fields are created based on your script ...

    I see where you set variables, but how do they interact with the script ?

    http://biiainsurance.com/builders-risk-form/

    For instance: This is the input field

    <input type="text" readonly="readonly" class="form-readonly  form-textbox validate[required]" data-type="input-textbox" id="input_72" name="q72_premiumDue" size="20" value="" />

    and I see in the code where you set the variable:

    predue    = document.getElementById('input_72'),

    and then do the calculation but now does it know to put the value back in?

    Im know very little about javacript but feel bad asking so many questions .. figure if I can understand what you did a little better I could stop asking so many questions ...

    //estimated value, premium due, authorize.net

    estivalue.onclick = estivalue.onchange = function(){

      predue.value = ((ratevalue.value * estivalue.value)/100).toFixed(2);

      authonet.value = predue.value;



    Here is my guess at it:

    id="input_72" so when you declare it at as predue.value the calculation then sets the value of input_72 based on what gets passed to predue.value ?

    then authonet.value becomes the predue.value and since "
    authonet  = document.getElementById('input_69_donation'); "  anything passed to authonet.value would become that value so I could even say authonet.value = 123456 and it would set the variable authonet.value to 123456 ?

     


  • Profile Image
    JotForm Support

    Answered by jonathan on January 30, 2014 at 06:16 PM

    Hi,

    If I understand correctly, your latest question is... How input_72 or Premium Due have value?

    It was from the Calculated field (user guide: -How-to-perform-calculation-in-the-form)

     

    Hope this answers your question.

    Thanks.