Passing parameter to a function for onclick in an XSLT RSS


I have a link in a xslt file and some javascript methods in another file. When I click on the link, the javascript method invokes. I need to pass in a xsl value to the js method. OK, this sounds really confusing. Here is some code:

In the xsl file:

<a href=”#” onclick=”javascript:portal_openDispCalModalDialog(‘@xslparameter’)”>

<xsl:value-of select=”@Title” />


In the js file:

function portal_openDispCalModalDialog(id){

var options = {url:”list/DispForm.aspx?ID=”+id+”&IsDlg=1“,

dialogReturnValueCallback: CalDialogCallback


SP.UI.ModalDialog.showModalDialog(options);     }


I needed to build my onclick as an attribute and then add the data inside it.

<a href=”#”>
<xsl:attribute name=”onclick”>
javascript:portal_openDispCalModalDialog(‘<xsl:value-of select=”@ID”/>’)
<xsl:value-of select=”@Title” />




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s