The Discount field does not register
(discount is supposed to subtract from Grand Total)( check discount sample )
check the the jsfiddle click here
I want it to act like this picture. (with the discount being manually inputed) http://i.dailymail.co.uk/i/pix/2013/02/07/article-2275089-17694138000005DC-460_634x497.jpg
Javascript
function recordToFilename() {
var input = document.getElementById('discountvalue'),
discount12 = input.value;
Change your button to
<input type="button" onclick="recordToFilename();" value="Submit Discount" />
And function
function recordToFilename() {
var input = document.getElementById('discount'),
discount12 = input.value;
alert (discount12);
}
you have 2 id="discount". Change one of the id and the there is no problem to register the input value to discount12.
Put this line document.getElementById('discounts').innerHTML = "<strong>Discount </strong>: $" + (salesTotal * 0.14 + salesTotal - discount12).toFixed(2);
in your recordToFilename()
method and make sure your variable is chage to discount12
not discount
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.