Heb een function gemaakt die een prijs moet berekenen aan de hand van waardes in tekstboxen, nu wil ik dat als de waarde in de textbox voor hoogte wijzigt (onChange) de functie opnieuw wordt aangeroepen.
In de onderstaande codes staan testwaardes....
Kan dit wel met onChange? Of moet ik een link maken die naar calculate.asp?opnieuw=ja verwijst en dat de functie pas wordt uitgevoerd als de waarde ja is bij opnieuw?
In de onderstaande codes staan testwaardes....
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| Function CalcTotal(prijs,aantalletters)
hoogte = 888
aantalletters = 10
If hoogte >= 30 and hoogte <= 39 then prijs = 0.60
If hoogte >= 40 and hoogte <= 49 then prijs = 0.65
If hoogte >= 50 and hoogte <= 59 then prijs = 0.75
If hoogte >= 60 and hoogte <= 69 then prijs = 0.80
If hoogte >= 70 and hoogte <= 79 then prijs = 0.85
If hoogte >= 80 and hoogte <= 89 then prijs = 0.96
If hoogte >= 90 and hoogte <= 99 then prijs = 1.05
If hoogte >= 90 and hoogte <= 99 then prijs = 1.05
If hoogte >= 90 and hoogte <= 99 then prijs = 1.05
CalcTotal=FormatCurrency(prijs*aantalletters)
End Function |
Kan dit wel met onChange? Of moet ik een link maken die naar calculate.asp?opnieuw=ja verwijst en dat de functie pas wordt uitgevoerd als de waarde ja is bij opnieuw?