hello peeps,
I was getting some bogus results when trying to validate a date field, i've finaly worked out what is giving the error but don't understand why, here is the logic...
I have a field , you enter 08/01/2007
I then do a split on it with "/" , ->
if i display dateArray[0] is shows "08" , everything fine here, but then....
to ensure I am passing numbers to the date function I parseInt each section of the date array, like so...
however if I then display (alert) the variable day it is = 0 (ZERO) huh why ?
if I enter 01,02,03 etc.. up to 07 , parseInt shows 1,2,3,4,5,6,7 HOWEVER 08 & 09 come back as = 0 , only those two come back as zero, why? they should come back as 8,9 , what on earth is going on?
A very confused 1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
I was getting some bogus results when trying to validate a date field, i've finaly worked out what is giving the error but don't understand why, here is the logic...
I have a field , you enter 08/01/2007
I then do a split on it with "/" , ->
Code:
var dateArray = value.split("/");
if i display dateArray[0] is shows "08" , everything fine here, but then....
to ensure I am passing numbers to the date function I parseInt each section of the date array, like so...
Code:
var day = parseInt(dateArray[0]);
however if I then display (alert) the variable day it is = 0 (ZERO) huh why ?
if I enter 01,02,03 etc.. up to 07 , parseInt shows 1,2,3,4,5,6,7 HOWEVER 08 & 09 come back as = 0 , only those two come back as zero, why? they should come back as 8,9 , what on earth is going on?
A very confused 1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.