I have looked up and down trying to figure this out, I am trying to make a simple calculation on change event with 3 textbox inputs
Cost of Item textbox
Discount Percentage which would be entered manually of value exp: 29
Total: which will equal the Cost *'s Discount equal the new Total.
When Discount or Cost is changed then the Total will change with them I have the javascript of getting the total somewhat...but i also need to format the Cost & Total from numeric to currency instead of 2500 it formats to $2,500.00 etc
Any help is appreciated im new to this and still learning but im just lost
var number = 14000;
var percentToGet = 29;
var percent = (percentToGet / 100) * number;
alert(percentToGet + "% of " + number + " is " + percent);
function calculatePercent(percent, num){
return (percent / 100) * num;
This gives me the discount of 4,060 of 14,000 which total becomes 9,940
I may need to use jquery or ajax but i have no idea where to begin.