• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cffunction call with a href tag

New Here ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

cffunctions are only available to coldfusion on the server side not the client side. you want a javascript function if you want to use a client-side href to access it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 28, 2006 Jun 28, 2006

Copy link to clipboard

Copied

Thanks

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

Millx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2006 Jun 29, 2006

Copy link to clipboard

Copied

LATEST
> I am trying to call a cffunction using a href tag (like a link).
> The cffunction call shall be done onclick.

<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>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation