Auto adjust interest rate base on selected terms
I have text field where users will input the terms example, (24,12,8) months, and I have text field for rate where the result of terms and given multiplier will show. I want the rate will auto adjusted when I change the terms.
based in given computation.
example only: 24 (months) x 0.02 (given) + 1 (given) = 1.48 (rate)
The problem is I didn't get the correct result on rate field when I change the terms. any ideas?
This is what I've done
- <script type="text/javascript">
- $(document).ready(function(){
- $(".input").keyup(function(){
- var val8 = +$(".sales_terms").val();
- var percent = 0.02;
- var exempt = 1;
- $("#sales_interestrate").val(Math.round(val8*percent+1));
- });
- });
- </script>
Help would appreciated. thanks