Javascript setting Maximun & Minimum Answers
I need to ensure the minimum answer is 5 and the maximum can be no larger
than 25. The code I use is:
function temp(form)
{
var i = parseFloat(form.Inc.value, 10);
var c = 0;
c = 25 - ((300 - i) * 8.0 / 100);
form.Fee.value = c.toFixed(2);
function decrease(form){
if (c > 25) {
c--;
document.getElementById('Fee').innerHTML = 25;
}
}
function increase(form){
if (c < 5) {
c++;
document.getElementById('Fee').innerHTML = 5;
}
}
}
However the answer box in the form doesn't recognise the minimum and
maximum figures. Any help appreciated. Thanks
No comments:
Post a Comment