javascript regular expressions

Posted by Zhasulan Berdybekov on Stack Overflow See other posts from Stack Overflow or by Zhasulan Berdybekov
Published on 2011-01-10T12:09:07Z Indexed on 2011/01/10 12:54 UTC
Read the original article Hit count: 126

Filed under:
|
|

Help me with regular expressions. I need to check the text on the hour and minute. That is the first case, the text can be from 0 to 12. In the second case, the text can be from 1 to 60.

this is my code:

var hourRegEx = /^([0-9]{2})$/; //You can fix this line of code?

$(document).ready(
  function(){
     $('form.form').submit(function(){ 
  if( $('input.hour').val().match(hourRegEx) ){
      return true;
  } 
  return false;
  });
});

In my case, the code says that, for example 52, too, the correct answer

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery