Can anyone tell me if there is something wrong with my code? I have dropdown menu that lists payment methods. If the user selects one of the credit cards on the list, I want the JS to calculate the fee and show in another form field on screen.
For some reason, no matter what is selected it keeps using the default value for the calculation. HELP!!
Here is the js code that fires when a Calculate button is clicked.
var type = document.getElementById("paymentmethod");
var perct = .03;
case 'American Express':
var perct = .0325;
case 'Master Card':
var perct = .003;
var perct = 5;
cogs = document.mainform.cogs.value
document.mainform.creditfee.value = (cogs*perct).toFixed(2);