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 can I implement a custom labor charge on top of item sub total?

    Asked by Spade12 on August 01, 2011 at 03:13 AM

    Hey there, I'm trying to put together an order form with various AV equipment.  I want to be able to include a 25% labor charge when orders are at least $90.00.  So far I tried adding a few lines to jotform.jss with no avail, here are the changes I made:

     

    /**
         * Calculates the payment total with quantites
         * @param {Object} prices
         */
        
    countTotal: function(prices){
        
            var 
    total 0;
            
    $H(prices).each(function(pair){
                
    total parseFloat(total);
                var 
    price parseFloat(pair.value.price);
                if ($(
    pair.key).checked) {
                    if ($(
    pair.value.quantityField)) {
                        
    price price parseInt($(pair.value.quantityField).getSelected().text10);
                    }
                    
    total += price;
                }
            });
            
            if (
    total === 0) {
                
    total "0.00";
               }
         else if (
    total 90){
                
    total += (total .25);
           }
            if ($(
    "payment_total")) {
                $(
    "payment_total").update(parseFloat(total).toFixed(2));
            }
        },
        
    /**
         * Sets the events for dynamic total calculation
         * @param {Object} prices
         */
        
    totalCounter: function(prices){
            
    $H(prices).each(function(pair){
                $(
    pair.key).observe('click', function(){
                    
    JotForm.countTotal(prices);
                });
                if ($(
    pair.value.quantityField)) {
                    $(
    pair.value.quantityField).observe('change', function(){
                        $(
    pair.key).checked true;
                        
    JotForm.countTotal(prices);
                    });
                }
            });
        }, 
  • Profile Image

    Answered by brx250 on August 02, 2011 at 03:27 AM

    Hi brady,

    Your question has already been answered through your first post. Please follow this thread.

    https://www.jotform.com/answers/36678-Adding-custom-rate-to-dynamic-total#1

    Thank you.

    _____________________________________________ 

    Albert JotFrom Support