• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfinput validate="time" AM/PM

Guest
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

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" --->
<cfinput
type="text"
name="fStartTime"
label="Start Time"
message="Enter time as h:mm AM/PM"
mask="H:NN A"
validate="time"
value="#vStartTime#"
size="10" maxlength="10">



H:NN A A

Urls:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=C...
http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=C...
TOPICS
Advanced techniques

Views

462

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation