I am trying to validate a smallint field that should have equal or more then 13 or equal or less then 65 and if it left null then it is ok.
if (columbia_total == null || columbia_total == '' && columbia_total >= '13' || columbia_total <= '65' )
{
}
else
{
message += 'columbia_total should be between 13 and 65.\n';
}
It informs you if you enter any number more then 65 but not less then 13.
Can some one please let me know why equal or more then 13 is not detecting any value less then 13.
Patrick’s code is wonderfully precise and the ‘!columbia_total’ returns a boolean result which literally means that columbia_total column has nothing in it.
The ‘!’ is javascript operator for ‘NOT’
That said, you have now clarified that it must have a value and that value must be >=13 and <=65 so you should be simplifying the test to: