I have 1 select, 2 text inputs & some JSON data in a form:
- select input: List of Suppliers
- text input 1: Net Amount
- text input 2: Gross Amount
- JSON Data:contains the rates of various suppliers as
JSONinsupplier_tax_rates
I am calculating Gross Amount something like this(pseudo code):
grossAmount = NetAmount + ((currently_selected_supplier.tax_percentage_charged / 100) * netAmount)
Here is the complete code:
Calculate total after retriveing tax rate from JSON
Now, this should work but it doesn’t. I get NaN(not a number), means something is wrong. But I have trouble find where.
You have multiple problems in your code. Here is the correct version:
DEMO: http://jsfiddle.net/A9vmg/18/