I am comparing two text fields and the second field value has to behigher than the first field value.The code is as under:-
function fixPctEnd(tf, perst)
if((tf.value < perst)&(perst !=0))
alert('Please enter percentage that is same as or higher than '+perst);
tf.value = "";
<input type="text" size="5" name="base" value="">% and
<input type="text" size="5" name="max" value="" onChange="fixPctEnd(this,form.base.value)">%
WHen I enter single digit or double digits in both the fields then, it works fine. I try 12 in the first and 2 in the second, it does not give the alert ??? where am I going wrong......need help. Also, when enter 1 instead of 2 in the second field(with first field as 12) it works.