[Top] [All Lists]

Using variables on included files?

Subject: Using variables on included files?
From: "Steve Grosz"
Date: Wed, 31 Dec 2008 20:49:22 -0700
Newsgroups: macromedia.coldfusion.cfml_general_discussion

Can you not use #variable# on a file that is added on an existing .cfm file with <cfinclude> ??

I have:

<cfquery name="check_user" datasource="SalleBoise">
           select u_id,u_fName,u_lName,u_foil_rating,u_foil_year
  from tournfencer
  where u_user='#form.Username#'

<cfinclude template="inc/event_reg.cfm">

- event_reg.cfm is-
<cfform name="form1" method="post" action="CF/process2.cfm?pmode=a&tid=#url.tid#" id="FormBorder" style="margin-top:2px;"><span class="bold">Events competing in:</span><table width="98%" border="0">
<cfif #url.f# eq 1>
   <td width="15%" align="center">Open Foil</td>
<td width="10%" align="center"><input name="OpenFoil" type="checkbox" value="1" checked="yes" onClick="optionFoil(this.form)"> </td>
 <cfif #url.e# eq 1>
   <td align="center">Open Epee </td>
<td align="center"><input name="OpenEpee" type="checkbox" value="1" checked="yes" onClick="optionEpee(this.form)"></td>

<cfset id=createuuid()>
<input type="hidden" name="id" value="<cfoutput>#id#</cfoutput>">
<input type="hidden" name="fRating" value="<cfoutput>#check_user.u_foil_rating#</cfoutput>">
<div align="center">
<input name="Submit" type="submit" value="Register" onClick="return checkmail(this.form.FencerEmail)">

But if I dump the variable #fRating#, I get a message that says Element U_FOIL_RATING is undefined in CHECK_USER

<Prev in Thread] Current Thread [Next in Thread>