Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 22nd, 2012  |  syntax: None  |  size: 0.23 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Javascript Form Validation 4 Number Option
  2. var input = document.getElementById("myInput");
  3. var validNumbers = /^(123|777|989|111)$/;
  4. var isFormValid = validNumbers.test(input.value);
  5. if (!isFormValid)
  6. {
  7.     alert("Not Valid");
  8. }