title: javascript function to accept only 4 digit number
body: <p>I have a html form with a javascript script defined default value. I am trying to add another javascript that would deny the form being submitted if its empty and on its default value but I cant get to work to deny the form being submitted if the input is characters or non-numeric.</p>
  
  <p>This is the javascript</p>
  
  <pre><code>$('#form1').submit(function(e) {
    if ($.trim($('#store').val()) === "" || $.trim($('#store').val()) === "Enter store number'(nnnn)'" || $.trim($('#store').val()) === isNaN(e)) {
      e.preventDefault();
      alert('Please type in store number');
    }
  });
  </code></pre>