I have a javascript function intended for form validation as follows:
- Code: Select all
if(document.form1.textbox1.value > document.form1.textbox2.value)
{
alert('Please ensure text box 2 is greater than text box 1');
return false;
}
return true;
This works to a certain extent, however it seems that javascript is ignoring the 0's i enter.
For example, when I enter 100 it will recognize this as 1. So that if I enter 20 in text box 1 and 100 in text box 2 it will give an error as it see's 2 is greater than 1.
Sorry if this seems stupid but I really cannot figure it out, any help would be greatly appreciated,
John


