Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 448251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:39:04+00:00 2026-05-12T21:39:04+00:00

The invoice input values which hold the totals of invoice line items that get

  • 0

The invoice input values which hold the totals of invoice line items that get updated via JS return a NULL value when they are submitted.

<span class="sublabel">Subtotal</span><input type="text" class="total-box" id="product-subtotal" readonly="true" />
<span class="sublabel">Tax</span><input type="text" class="total-box" id="product-tax" readonly="true" />
<span class="sublabel">Total</span><input type="text" class="total-box" id="order-total" readonly="true" />

The JS

function calcProdSubTotal() {

    var prodSubTotal = 0;

    $(".row-total-input").each(function(){

        var valString = $(this).val() || 0;

        prodSubTotal += parseInt(valString);

    });

    $("#product-subtotal").val(prodSubTotal);

    };

function calcTaxTotal() {

    var taxTotal = 0;
    //var taxAmount = 10;   
    var taxAmount = $("#salesTaxAmount").val() || 0;

    var productSubtotal = $("#product-subtotal").val() || 0;

    var taxTotal = parseInt(productSubtotal) * parseInt(taxAmount) / 100;
    var taxTotalNice = taxTotal;
    $("#product-tax").val(taxTotalNice);

};

function calcOrderTotal() {

    var orderTotal = 0;

    var productSubtotal = $("#product-subtotal").val() || 0;
    var productTax = $("#product-tax").val() || 0;

    var orderTotal = parseInt(productSubtotal) + parseInt(productTax);
    var orderTotalNice = "$" + orderTotal;

    $("#order-total").val(orderTotalNice);

};



$(function(){
    $('.row-total-input').each(
        function( intIndex ){
            $('.invAmount').livequery('blur', function() {
                    var $this = $(this);
                    var amount = $this.val();

                    var qty = $this.parent().find('.invQty').val(); 

                    if ( (IsNumeric(amount)) && (amount != '') ) {           
                        var rowTotal = qty * amount;   
                        $this.css("background-color", "white").parent().find(".row-total-input").val(rowTotal); 
                    } else {        
                        $this.css("background-color", "#ffdcdc");                     
                    };                              
                    calcProdSubTotal(); 
                    calcTaxTotal()
                    calcOrderTotal();
            });
        }
    );
});

I originally had the inputs set as disabled however I have changed them to readonly because disabled fields can’t be submitted.

What am i missing?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:39:04+00:00Added an answer on May 12, 2026 at 9:39 pm

    You haven’t set a name-attribute on your <input />s, so PHP can’t access their values, and returns nothing when you look for $_POST['product-tax']. If you have set error_reporting to E_ALL, you should see a notice telling you you are trying to access an undefined index on the $_POST array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have an Invoice Line Items table and a Products table, and I
I have a HTML form that mimics invoice input form. This is the way
I have this html <div> <input type=radio name=erp_report_type value=customerinvoice required> <label for=>Customer Invoice</label> <input
I get poorly formatted invoice-related email from my payment gateway. I want to automatically
Suppose we have a Invoice that is saved in a draft state in a
Assume we have an Invoice entity which has many InvoiceDetails . Each invoice detail
I have got a return from a server which is a block of html,
I want to pass selected value on invoice.php file using jQuery. After sending value
We have a script that generate invoice once a month (cron). But we would
I'm creating a form to input an invoice with dynamically added rows ( as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.