<html> <head> <script type='text/javascript'> function ValidateTime(input) { var regex3 = /^(1[0-2]|\d)\:\d{2}\s{0,}[APap][Mm]$/; return input.match(regex3); } function input_click() { var input = document.getElementById('input').value; if (ValidateTime(input)) alert('[' + input + '] is a valid time'); else alert('[' + input + '] is NOT a valid time'); } </script> </head> <body> Start Time: <input type='input' id='input' /> <br/> <input type='submit' value='Test' onclick='input_click();' /> </body> </html>
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.