Hi all,
i'm a newbie to javascript and I am trying to use it to validate some user input data for a html form. I am stuck on checking if the user has input a time value in the correct format hh:mm:ss
so far i've got
var regTime = /^\d{2}\:\d{0-5}\d\:\d{0-5}\d$/
i'm trying mkae it so that 2 digits are followed by a colon, then a digit less than 6, a digit,a colon,a digit less than 6 and another digit. I've tried lots of variations but can't seem to find the right one. I know it's the 'digit between 0 and 5' that won't work and the expression above is rejected by the browser. Any ideas???
Manni
i'm a newbie to javascript and I am trying to use it to validate some user input data for a html form. I am stuck on checking if the user has input a time value in the correct format hh:mm:ss
so far i've got
var regTime = /^\d{2}\:\d{0-5}\d\:\d{0-5}\d$/
i'm trying mkae it so that 2 digits are followed by a colon, then a digit less than 6, a digit,a colon,a digit less than 6 and another digit. I've tried lots of variations but can't seem to find the right one. I know it's the 'digit between 0 and 5' that won't work and the expression above is rejected by the browser. Any ideas???
Manni