Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript within <cfoutput> tags

Status
Not open for further replies.

lminmei

Programmer
Joined
Feb 1, 2000
Messages
111
Location
US
I cannot get my rollovers to work when the javascript is inside the <cfoutput> tags....However, my javascript window.open works fine....and when i comment out the <cfoutput> tags, the rollover works fine....
FYI: I need the cfoutputs because this a a table returning a search query...
Please help!

Here's the code for the rollover:

<cfoutput>

<a href=&quot;##&quot; onmouseover=&quot;preview.src='../Images/preview_over.gif'&quot; onmouseout=&quot;preview.src='../Images/preview.gif'&quot; onclick=&quot;window.open('print.cfm?recordid=#id#&cfid=#cfid#&cftoken=#cftoken#','help','width=636,height=580,scrollbars=yes,resizable=yes,menubar=yes');preview.src='..Images/preview_check.gif'&quot; title=&quot;View Printable Record&quot;><img src=&quot;../Images/preview.gif&quot; border=&quot;0&quot; name=&quot;preview&quot;></a>

</cfoutput>
 
here's the code that came back from coldfusion server...

<a href=&quot;#&quot; onmouseover=&quot;preview.src='../Images/preview_over.gif'&quot; onmouseout=&quot;preview.src='../Images/preview.gif'&quot; onclick=&quot;window.open('print.cfm?recordid=3310&cfid=70&cftoken=21713100','help','width=636,height=580,scrollbars=yes,resizable=yes,menubar=yes');preview.src='../Images/preview_check.gif'&quot; title=&quot;View Printable Record&quot;><img src=&quot;../Images/preview.gif&quot; border=&quot;0&quot; name=&quot;preview&quot;></a>
 
Hi,
Don't put whole javascript under <cfoutput> tag. Instead use seperate output tag for each table / search variable:

<a href=&quot;##&quot; onmouseover=&quot;preview.src='../Images/preview_over.gif'&quot; onmouseout=&quot;preview.src='../Images/preview.gif'&quot; onclick=&quot;window.open('print.cfm?recordid=<cfoutput>#id#</cfoutput>&cfid=<cfoutput>#cfid#</cfoutput>&cftoken=<cfoutput>#cftoken#</cfoutput>','help','width=636,height=580,scrollbars=yes,resizable=yes,menubar=yes');preview.src='..Images/preview_check.gif'&quot; title=&quot;View Printable Record&quot;><img src=&quot;../Images/preview.gif&quot; border=&quot;0&quot; name=&quot;preview&quot;></a>
 
i cannot do the individual cfoutput tags because that image rollover field has to be in that cfoutput
here's the full code from the beginning of the <cfoutput> tags:

<cfoutput query=&quot;Result&quot; startrow=&quot;#PT_StartRow#&quot; maxrows=&quot;#records_to_display#&quot;>
<tr <cfif Result.CurrentRow MOD 2 eq 1> bgcolor=&quot;##FFFFFF&quot; <cfelse> bgcolor=&quot;##fef5d8&quot; </cfif>>
<td valign=&quot;top&quot;>
<a href=&quot;edit.cfm?template=ed&recordid=#ID#&cfid=#cfid#&cftoken=#cftoken#&quot;>[edit]</a>
</td>
<td valign=&quot;top&quot;>
<a href=&quot;edit.cfm?template=dl&recordid=#ID#&cfid=#cfid#&cftoken=#cftoken#&quot;>[delete]</a>
</td>
<!--- <td valign=&quot;top&quot;>
</td> --->
<td valign=&quot;top&quot;><b>#ID#</b>
<br>
<a href=&quot;##&quot; onmouseover=&quot;preview.src='../Images/preview_over.gif'&quot; onmouseout=&quot;preview.src='../Images/preview.gif'&quot; onclick=&quot;window.open('print.cfm?recordid=#id#&cfid=#cfid#&cftoken=#cftoken#','help','width=636,height=580,scrollbars=yes,resizable=yes,menubar=yes');preview.src='../Images/preview_check.gif'&quot; title=&quot;View Printable Record&quot;><img src=&quot;../Images/preview.gif&quot; border=&quot;0&quot; name=&quot;preview&quot;></a>
</td>
<td valign=&quot;top&quot;>#TRIM(StaffID)#</td>
<td valign=&quot;top&quot;>#TRIM(DateFormat(CallDate,'MM/DD/YYYY'))#</td>
<td valign=&quot;top&quot; align=&quot;center&quot;>#TRIM(ResponseRequired)#</td>
<td valign=&quot;top&quot; align=&quot;center&quot;>#TRIM(Status)#</td>
<td valign=&quot;top&quot;>#TRIM(FirstName)# #TRIM(LastName)#</td>
<td valign=&quot;top&quot;>#TRIM(DispositionCategories)#</td>
<td valign=&quot;top&quot;>#LEFT(CallerRequests,100)#
<cfif LEN(#CallerRequests#) GT 100><b><font color=&quot;##FF0000&quot;>...</font></b></cfif>
</td>
<td valign=&quot;top&quot;>#TRIM(CallerEmployer)#</td>
<td valign=&quot;top&quot;>#LEFT(CurrentDisposition,100)#
<cfif LEN(#CurrentDisposition#) GT 100><b><font color=&quot;##FF0000&quot;>...</font></b></cfif>
</td>
</tr>
</cfoutput>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top