runnerjp Posted March 11, 2009 Share Posted March 11, 2009 currently i have function checkit(which) { var tim = which.value; var flag = 0; if (!/^\d{1,2}[-:\.]\d{2}/.test(tim)) { // basic format flag = 1; } tim = tim.replace(/[-\.]/g,":"); tim = tim.split(/:/); if ((tim[0] > 23) || tim[1] > 59) { // hour or minute values too great flag = 1; } if (flag == 1) { alert ("This field requires a valid time!" ); which.value = ""; which.focus(); return false; } } but the thing is it wont allow i time such as 45.6's to be entred...how could i chnage this? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.