From: rillex on
I am trying to call a cffunction using a href tag (like a link). The
cffunction call shall be done onclick.

Onclick works fine on links to pages. My problem is that when calling a
cffunction with a href tag the function call executes every time and not
onclick.

My code:

-
-
-
<cfoutput query="ticket">
<a href=#getVotes(ticket.n11)#> #n11# </a>
</cfoutput>
-
<cffunction name="getVotes">
<cfargument name="ItemId" required="true">
-
</cffunction>

Best regards

Millx

From: rillex on
Thanks

Do you know where I can find info. on that subject?

Millx
From: BKBK on
[i]> I am trying to call a cffunction using a href tag (like a link).
> The cffunction call shall be done onclick.[/i]
<a href="daPage.cfm?x=1&y=2&z=3">run daFunc upon de click</a>

daPage.cfm
==========
<cfif isDefined("URL.x") and isDefined("URL.y") and isDefined("URL.z")>
<cfoutput>#daFunc (url.x,url.y,url.z)#</cfoutput>
<cfscript>
function daFunc (a,b,c) {
return "daFunc ran OK. Arguments: #a#, #b#, #c#";
}
</cfscript>
</cfif>