title: Javascript Prompt Cancelled Not Behaving in While Loop
body: <p>I have a prompt that basically is a required field and cannot contain a decimal.  I have a while loop that should continue to prompt the user for information until a number is indicated regardless of whether OK or Cancel are clicked.  Everything works fine as long as the OK button is clicked.  It continues to prompt if left blank and OK is clicked or if a number with a decimal is provided and OK is clicked.  But if cancel is clicked, it doesn't continue to prompt.</p>
  
  <pre><code>var rmiles = prompt("Please indicate actual miles driven for payroll");
      while (rmiles == null | rmiles == "null" | rmiles == " " | rmiles.indexOf(".") != -1) {
          alert("Mileage is required when arriving on site and can only be whole numbers.  No Decimals.  Please enter 0 if you did not intend to arrive on site.");
          rmiles = prompt("Please indicate actual miles driven for payroll");
      }
  </code></pre>