Category Archives: validation

Select atleast two check box No ratings yet.

If you want to force user to select at least two check box among several check box. You can do it like this:

  Likes(0)Dislikes(0) Please rate this Sample rating item

Accept only numbers from user using javascript No ratings yet.

Among all browser few browsers use keyCode, others use which. If you’re using jQuery, you can reliably use which. Method 1: The below JavaScript code can be used to validate user input to accept only numbers:

  if (charCode > 31 && (charCode < 48 || charCode > 57)): This checks that the key… Read More »