How do I get this simple sales tax calculator to not break and clear fields?

$Jester#

New Member
All I'm trying to do is get this not to break when I press calculate, and have the clear button clear the two text fields. I know I have a simple error and it's a quick fix, thanks for the help!http://jsfiddle.net/Be9P6/HTML:\[code\]<form id="form">Sub total: <input id="subtot" value="http://stackoverflow.com/questions/15648741/5" type="text"/><br/>Tax %: <input id="tax" value="http://stackoverflow.com/questions/15648741/6" type="text" /><br/><input id="calc" type="submit" value="http://stackoverflow.com/questions/15648741/Calculate" /><input id="reset" type="submit" value="http://stackoverflow.com/questions/15648741/Clear" /></form>\[/code\]jQuery:\[code\]$(function () { $('#calc').click(function(){ var taxf = ($('#tax').val() / 100); var tot = ($('#subtot').val() * (taxf + 1)).toFixed(2); alert("Your total is $" + tot); $('#form').submit(); }); addTax()})\[/code\]
 
Back
Top