我们并不总是要加税订购,所以我需要一种方式,税收将被默认忽略,除非指定。乘以税收和增加总金额
所以我有下面的文本框:
<input class="txt1" type="text" name="subtotal" value="" id="subtotal"
size="16" tabindex="42" onChange="enableBeforeUnload();"
onKeyUp="enableBeforeUnload();">
我有这样的文本框中正常工作,它求和值。
我有我试图通过税收百分比相乘并显示共有两个文本框:
<input class="txt1" type="text" name="tax" id="tax" value="1" size="16" tabindex="42"
onChange="enableBeforeUnload();" onKeyUp="enableBeforeUnload();">
<input class="txt2" type="text" name="total1" value="" id="total1" size="16"
tabindex="42" onChange="enableBeforeUnload();" onKeyUp="enableBeforeUnload();">
我尝试使用没有运气以下:
var tax = +$("#tax").val(), // get tax and convert to a number
total = tax ? sum * tax : sum; // if tax is a non-zero number multiply
// otherwise just take the sum as is
这:
totAmt.val(sum + sum*parseFloat(taxAmt.val()/100));
我无法正确实施。 在此先感谢。
http://jsfiddle.net/thetylercox/jh2Ne/7/我库仑dnot得到这个工作,正确 http://soldbybillcox.com/treasure/demo.php其工作在这里很好
的JS小提琴你已经链接,既没有在与您的税务计算方法似乎没有做此刻什么... - 是这样吗? – anotherdave 2012-07-18 17:34:42
进出口新的JS拨弄我有工作在我的网站我只是想出来http://soldbybillcox.com/treasure/demo.php @anotherdave – 2012-07-18 17:47:05