Skip to main content
Participating Frequently
November 26, 2018
Question

CFINPUT and CFDIRECTORY tags reading dates incorrectly

  • November 26, 2018
  • 1 reply
  • 448 views

Its a new setup on my laptop, all configuration is exact similar to prior. I see an issue now with cfinput type datefield 11/30/2018 is an invalid date or time string. i have tried changing system date and time to mm/dd/yyyy format. Reinstalling Coldfusion multiple times.

Someone please suggest whats wrong here ? As the same set of code works on other systems.

<cfinput type="DateField" class="gcText9pt" name="end_dt" value="#DateFormat(end_dt, "mm/dd/yyyy")#" required="Yes" validate="USdate" size="10" maxlength="16" message="Enter a valid Fiscal End Date (e.g. mm/dd/yyyy )" mask="mm/dd/yyyy">

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
November 26, 2018

This example should contain what you're looking for:

<cfdump var="#form#">

<cfset end_dt=createdate(2018,11,30)>

<cfset setLocale("en_US")>

<cfform >

<cfinput type="DateField" class="gcText9pt" name="end_dt" value="#DateFormat(end_dt, 'mm/dd/yyyy')#" required="Yes" validate="USdate" size="10" maxlength="16" message="Enter a valid Fiscal End Date (e.g. mm/dd/yyyy )" mask="mm/dd/yyyy">

<cfinput name="sbmt" type="submit" value="send">

</cfform>