Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function checkTimeFormat(time) {
- // Modify this to check for your RegEX
- if (time == "") return false;
- return true;
- }
- function checkForm() {
- var time = $("#time").val();
- if (!checkTimeFormat(time)) {
- alert("Incorrect format for time!");
- return false;
- };
- }
- </script>
- <form action="/page.php">
- Time:<br>
- <input type="text" id="time"><br>
- <input type="submit" value="submit" onClick="return checkForm();">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement