?
Solved

cfinput error: Invalid token 'C' found

Posted on 2006-06-13
7
Medium Priority
?
2,380 Views
Last Modified: 2013-12-24
I have:

<cfinput <CFIF session.myTransactionMode eq "addPayment" AND session.myPaymentID neq "">disabled</CFIF>
tabindex="#myTab#" type="text" name="GiftDate" id="GiftDate" size="10" maxlength="10" onChange="formatDate(this);"
class=notetext2  onkeyup="PopulateDate(event);" accesskey="Z"
required="yes" message="Please enter Gift Date!"
value="<CFIF isDate(form.GiftDate)>#DateFormat(form.GiftDate,'m/d/yyyy')#<CFELSE>#form.GiftDate#</CFIF>">

This returns:

Invalid token 'C' found on line 143 at column 11.  
The CFML compiler was processing:

a cfinput tag beginning on line 143, column 2.
 
How do you fix this?

0
Comment
Question by:JohnLucania
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Assisted Solution

by:73Spyder
73Spyder earned 80 total points
ID: 16895994
class=notetext2

I think this should be this:

class="notetext2"
0
 

Author Comment

by:JohnLucania
ID: 16896136
still getting:

Invalid token 'C' found on line 143 at column 11.  
The CFML compiler was processing:

a cfinput tag beginning on line 143, column 2.

<cfinput <CFIF session.myTransactionMode eq "addPayment" AND session.myPaymentID neq "">disabled</CFIF>
tabindex="#myTab#" type="text" name="GiftDate" id="GiftDate" size="10" maxlength="10" onChange="formatDate(this);"
class="notetext2"  onkeyup="PopulateDate(event);" accesskey="Z"
required="yes" message="Please enter Gift Date!"
value="<CFIF isDate(form.GiftDate)>#DateFormat(form.GiftDate,'m/d/yyyy')#<CFELSE>#form.GiftDate#</CFIF>">
0
 
LVL 7

Assisted Solution

by:ExpertAdmin
ExpertAdmin earned 400 total points
ID: 16896423
I don't have a lot of insight on what may be causing it, but I would like to point out that this style of coding makes finding these types of errors very difficult. You may want to consider restructuring this statement more like this:

<CFIF session.myTransactionMode eq "addPayment" AND session.myPaymentID neq "">
     <CFSET Disabled ="disabled">
<CFELSE>
      <CFSET Disabled=""
</CFIF>


<CFIF IsDate(form.GiftDate)>
    <CFSET MyDate =DateFormat(form.GiftDate,'m/d/yyyy')>
</CFELSE>
        <CSET MyDate = form.GiftDate>
</CFIF>

<cfinput #Disabled# tabindex="#myTab#" type="text" name="GiftDate" id="GiftDate" size="10" maxlength="10" onChange="formatDate(this);"
class="notetext2"  onkeyup="PopulateDate(event);" accesskey="Z"
required="yes" message="Please enter Gift Date!" value="#MyDate#">

While this takes a little more code, it is much easier to see syntax errors and also to find out where an offending piece of code is.

M@
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
LVL 36

Assisted Solution

by:SidFishes
SidFishes earned 200 total points
ID: 16896654
not 100 % sure but i think the issues is you are trying to nest a cfif inside a cfinput...

afaik...you can do this kind of thing with a regular input tab but not within another cf tag as the parser sees

<cfinput <cfif

and throws an error because as far as it knows cfinput is unclosed

0
 
LVL 3

Assisted Solution

by:siva350
siva350 earned 120 total points
ID: 16897561
try this

<cfinput <CFIF session.myTransactionMode eq 'addPayment' AND session.myPaymentID neq ''>disabled</CFIF>
tabindex="#myTab#" type="text" name="GiftDate" id="GiftDate" size="10" maxlength="10" onChange="formatDate(this);"
class="notetext2"  onkeyup="PopulateDate(event);" accesskey="Z"
required="yes" message="Please enter Gift Date!"
value="<CFIF isDate(form.GiftDate)>#DateFormat(form.GiftDate,'m/d/yyyy')#<CFELSE>#form.GiftDate#</CFIF>">
0
 
LVL 3

Expert Comment

by:siva350
ID: 16897616
Nevermind, that wont work. HAve you tried using inline iif statements?
http://livedocs.macromedia.com/coldfusion/6/CFML_Reference/functions-pt1117.htm
0
 
LVL 18

Accepted Solution

by:
Plucka earned 1200 total points
ID: 16898292
JohnLucania,

You CAN NOT use a <CFIF within <CFINPUT

You can do this with standard <INPUT tags.

This will work

<cfset dis = "" />
<cfif session.myTransactionMode eq "addPayment" AND session.myPaymentID neq "">
    <cfset dis = "disabled" />
</cfif>

<cfif isDate(form.GiftDate)>
    <cfset dat = DateFormat(form.GiftDate,'m/d/yyyy') />
<cfelse>
    <cfset dat = form.GiftDate />
</cfif>

<cfinput #dis# tabindex="#myTab#" type="text" name="GiftDate" id="GiftDate" size="10" maxlength="10" onChange="formatDate(this);"
class=notetext2  onkeyup="PopulateDate(event);" accesskey="Z" required="yes" message="Please enter Gift Date!" value="#dat#" />

Regards
Plucka
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
What You Need to Know when Searching for a Webhost Provider
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

719 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