Javascript issue.
Posted: Sun Sep 04, 2005 10:33 am
Hi.
I am working on different measuring units calculator.
I am using a form to work this whole up.
The emtire calculation is done with JavaScript.
Today I worked ona routine that would disable the submit button if a user enetered zero: (I used the onKeyPress event inside the textfield where users enter the number. )
You just dont need to convert zero miles to zery knots, for example.
The problem is this case, that even if I enter the number "3" for example, or anyother numer if you like, it disables the submit buton. Why?
I am working on different measuring units calculator.
I am using a form to work this whole up.
The emtire calculation is done with JavaScript.
Today I worked ona routine that would disable the submit button if a user enetered zero: (I used the onKeyPress event inside the textfield where users enter the number. )
You just dont need to convert zero miles to zery knots, for example.
Code: Select all
function makeGrey() {
cValue = document.convert.InUnit.value / 1;
//Divding by 1 is incase someone input 00 or 000 and so on
if (cValue != 0) {
document.convert.submitButton.disabled=false;
}
else {
document.convert.submitButton.disabled=true;
}
}