I have simple little js function that is called by a custom validator for a textbox, basically to check if a time falls outside of a particular range.. the format of the time is ‘hh:mm‘
the ranges are written to js variables by the asp.net page read from the web.config..
here is the offending bit of the function..
function WarnOfOOOFlightTime(source, e){
var val = e.Value.split(':');
var minVal = oooMin.split(':');
var maxVal = oooMax.split(':');
var valHrs = parseInt(val[0]); //"07" here parses to 7
var valMins = parseInt(val[1]);
var minValHrs = parseInt(minVal[0]); //"08" here parses to 0!
var minValMins = parseInt(minVal[1]);
....
sure its something simple, but I am not getting it..
as usual any help much appreciated
thanks
You need to add the radix parameter to
parseInt(), otherwise it’ll attempt to treat numbers with leading zeroes as octal.