I ask the user to enter a time in the formatio 12:30 PM. onChange I
send the string to this function. I'm using alert boxes to test
it...and am always getting the "Does not work" alert box. What am I
doing wrong?
function checkTime(patte rn){
if(pattern.valu e.match(/[0-9] + :[0-9] + [0-9] + [aApP] + [mM]/)) {
alert ("works")
}
else alert(pattern.v alue + "Does not work")
}
send the string to this function. I'm using alert boxes to test
it...and am always getting the "Does not work" alert box. What am I
doing wrong?
function checkTime(patte rn){
if(pattern.valu e.match(/[0-9] + :[0-9] + [0-9] + [aApP] + [mM]/)) {
alert ("works")
}
else alert(pattern.v alue + "Does not work")
}
Comment