1 Reply Latest reply on May 24, 2006 10:21 AM by Dan Bracuk

    cfinput validate="time" AM/PM

      Ok just upgraded local server to 7.0.1
      i am still having problems.
      if i validate as time i cant use the AM/PM part of the mask.
      if i dont validate as time i can use a mask like 9:99 AA but its not a
      true time.

      Any help would be awsome!

      <cfset vStartTime = TimeFormat(getRecord.StartDateTime, 'h:mm tt')>

      <!--- Masks i have tried mask="9:99 AA" mask="h:mm tt" mask="H:NN A" --->
      label="Start Time"
      message="Enter time as h:mm AM/PM"
      mask="H:NN A"
      size="10" maxlength="10">

      H:NN A A

      http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm ?context=ColdFusion_Documentation&file=00000267.htm
      http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm ?context=ColdFusion_Documentation&file=00000279.htm#1100379
        • 1. Re: cfinput validate=&quot;time&quot; AM/PM
          Dan Bracuk Level 5
          Don't use validate="time" in cfinput. It's buggy. It returns false for values between 20:00 and 20:59, and it returns true for values like 13:62.

          As an alternative have a text box for the time (you can put in a mask to get your colon) and a select for the AM/PM. Write a js function to ensure that the 1st characters are between 0 and 12, and the last two are between 0 and 59.