Hi folks, I have been asked to make a commission calculator for a new department.
Basically, the calculations are thus
sell 0 - 10k = 0% commission
10k - 25k = 10% commission
25k - 35k = 15% commission
35k - 50k = 25% commission
50k+ = 35% commission
This calculator has to be on our website so people can see the potential they can earn by entering a figure they expect to sell in the box. Don't laugh at my attempt so far
Am I on the right track? I don't want to spend ages on it to find I've been doing it wrong, I haven't been given much time on it.
Basically, the calculations are thus
sell 0 - 10k = 0% commission
10k - 25k = 10% commission
25k - 35k = 15% commission
35k - 50k = 25% commission
50k+ = 35% commission
This calculator has to be on our website so people can see the potential they can earn by entering a figure they expect to sell in the box. Don't laugh at my attempt so far
Code:
<script type="text/javascript">
function commissionCalc(){
[indent]var enteredSales = document.getElementById("sales").value;
if (enteredSales < '10000') {
[indent]var earnings = enteredSales[/indent]
} else if (enteredSales > 10000 && enteredSales < 25000) {
[indent]var earnings = enteredSales = (enteredSales * 0.1)[/indent]
[/indent]
}
</script>
<form>
<input type='text' name='sales' />
<input type='text' name='commissionresult' />
</form>
Am I on the right track? I don't want to spend ages on it to find I've been doing it wrong, I haven't been given much time on it.