title: Validating time in Dashcode widget
body: <p>I am trying to validate 12 hour time without AM/PM in this input field. What is the best way to approach this? I have listed what I have currently which is not working out. Been looking for a couple days on how to approach this to no luck. </p>
  
  <pre><code>&lt;input id="dtstartf" type="text" name="time" value="08:00" class="apple-textfield apple-   no-children" apple-part="com.apple.Dashcode.part.textfield" onkeypress="time(event)"&gt;
  
  function time(event) {
    var regex = ["[0-2]",
    "[0-4]",
    ":",
    "[0-6]",
    "[0-9]",
    "(A|P)",
    "M"],
    string = $(this).val() + String.fromCharCode(e.which),
    b = true;
    for (var i = 0; i &lt; string.length; i++) {
      if (!new RegExp("^" + regex[i] + "$").test(string[i])) {
          b = false;
      }
    }
    return b;
  }
  </code></pre>