I'm using a DFWP and customising to send values to javascript function.
I've managed to pass certain types of variables from XSLT to Javascript using the below code.
<a><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="onClick">javascript:portal_openModalDialog("<xsl:value-of select='@ows_Title' />","<xsl:value-of select='@ows_ID' />")</xsl:attribute>test</a>
This works fine but when try to exchange ows_ID
for ows_Description
(Multiline field) nothing happens (function does not appear to work).
I tried escaping using disable-output-escaping
but still nothing works.
When I print out to screen I can see the value of xsl:value-of select="@ows_Description"
with and without the disable-output-escaping
.
I've copied @ows_Description
to a variable and then attempted to pass the variable instead but as previously the function doesnt work.
Finally I would also like to truncate the ows_Description
.
UPDATE: Think it might help to show output of @ows_Description (without disable-output-escaping)
<div class="ExternalClassB01973441A78460F8B02CD3603EF4C07"><p><span class="st">The James Dyson <strong>Award</strong> is an international design <strong>award</strong> that celebrates, encourages and inspires the next generation of design engineers. The <strong>Award</strong> is open ...</span></p></div>
Below is how it appears after changing the code as suggested (SPD has change automatically after save)
<a><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="onClick">javascript:portal_openModalDialog("<xsl:value-of select='@ows_Title' />","translate('<xsl:value-of select='@ows_Description' />','
','')") test