Context validation error for the cffunction tag

Posted on 2008-11-07
Last Modified: 2013-12-24
I am getting an error within my CFC stating that I am missing an end tag. I can see the end tag there just fine. I have isolated the function into its own cfc and the problem persists. A code snippet is attached.

I am getting the argument trying access the page as a WSDL. I have discovered that if I remove the <CFARGUMENT> line then it comes back fine.

Hopefully I am just missing something stupid. Thanks for any help!

<!--- begin component code --->


<!--- check for validly formatted exp date --->

<cffunction name="validExpDate" access="remote" returnType="string">

	<!--- set default values --->

	<cfset isValid = 1>

	<!--- required argument --->

	<cfargument name="expDate" type="String" required="No">


	<cfset expDate = "12/08">


	<!--- remove non-numerical values --->

	<cfset checkDate = #TRIM(ReplaceNoCase(arguments.expDate, "/", "", "ALL"))#> 


	<!--- check if four characters --->

	<cfif LEN(checkDate) IS 4>

		<!--- parse data into a date --->

		<cfset checkDate = #CreateDate("20#RIGHT(checkDate, 2)#", "#LEFT(checkDate, 2)#", 01)#>	

	<!--- check if 6 characters --->

	<cfelseif LEN(checkDate) IS 6>

		<!--- parse data into a date --->

		<cfset checkDate = #CreateDate("20#RIGHT(checkDate, 2)#", "#LEFT(checkDate, 2)#", "#MID(checkDate, 3, 2)#")#>	

	<!--- not 4 or 6 characters --->		


		<cfset isValid = 0>

	<!--- end character length check --->



	<!--- check if there is something to validate --->

	<cfif (isValid) IS NOT 0>

		<!--- check if date valid --->

		<cfif IsValid("Date", checkDate)>

			<!--- add a month to the date --->

			<cfset checkDate = #DateAdd("m", 1, checkDate)#>

			<!--- check if new date is in the past --->

			<cfif (checkDate) LT #now()#>

				<cfset isValid = 2><!--- indicates expired card --->


		<!--- date is not valid --->


			<cfset isValid = 0>


	<!--- end validation check --->



	<!--- return result --->

	<cfreturn isValid>




Open in new window

Question by:msfletch
    LVL 36

    Accepted Solution

    there can't be any tags between cffunction and cfargument (i -think- comments are ok though)

    <cffunction name="validExpDate" access="remote" returnType="string">
            <!--- required argument --->
            <cfargument name="expDate" type="String" required="No">

            <!--- set default values --->
            <cfset isValid = 1>

    LVL 4

    Author Closing Comment

    Thanks SidFishes! I was just in the process of trying that when I saw your message. Correct and quick as always.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now