IF THEN Issue jQuery(function()
Hi,
I am really sorry to bother you folks with such basics but I am pulling my hair out over using an if statement with this function below. I have next to 0 java experience and have spend all day trying to get this working.
I am trying to make a slider/calculator to allow someone to work out total cost/discount
Inputs:
Course Type Wanted (Drop down but would like an option list if I can figure it out)
No of Weeks
Outputs
PricePerWeek (Works OK)
TotalToPay (Works OK for now but will need to deduct the discount)
Discount (Needs IF No of Weeks >= 3 THEN give a 10% discount)
At the moment its hardcoded to
discount = 765 and when I try something like
if
(noofweeks >= 3
) {
noofweeks * priceperweek * 0.1
;
}
it just results in the slider not appearing.
- jQuery(function() {
- var tarif = 600000,
- // result_outptut = jQuery("#revenue span"),
- // discount_outptut = jQuery("#discount span"),
- client = 0,
- revenue = 0,
- check = 0,
- bob = 66,
- time = 0;
-
- function recount() {
- revenue = (client + check + time) * tarif;
- discount = 765
- //if($a > $b) { echo "<p>A is larger than B</p>";}
- // result_outptut.html(revenue + ' COP');
- jQuery("#revenue span").html(revenue + ' COP');
- jQuery("#discount span").html(discount + ' COP');
- jQuery("#priceperweek span").html(tarif + ' COP');
Any ideas?