Show/Hide Text Options
dcrug
Posted: Thursday, May 15, 2008 8:25:03 PM
Rank: Newbie

Joined: 5/2/2008
Posts: 22
Location: NYC
I have a table that displays:
Job Title
Job Description

I have a xslt for-each statement displaying each of the nodes in the subpages of the loop. I was curious to know if there is a way to have the javascript show/hide the job descriptions in a table.
The Property is Career Description and it has new text for each page. And i want to be able to show hide each job descriptions individually. Right now only the first Career Description is showing and hiding.


<table id="careers" border="0" cellspacing="0" cellpadding="5">

<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
<tr>
<td valign="top">
<br></br>
<a href="javascript:void();" onclick="show_hide('col1')">
<xsl:value-of select="@nodeName"/></a>

</td>
</tr>

<tr >
<td id="col1">
<xsl:value-of select="data [@alias = 'CareerPosition']" disable-output-escaping="yes"/>
</td>
</tr>
</xsl:for-each>

</table>
mortenbock
Posted: Thursday, May 15, 2008 9:00:15 PM

Rank: Addict

Joined: 7/19/2006
Posts: 791
Location: Århus, Denmark
You could use the position() method to get unique ID's like this:

Code:


<table id="careers" border="0" cellspacing="0" cellpadding="5">

<xsl:for-each select="$currentPage/node [string(data [@alias='umbracoNaviHide']) != '1']">
<tr>
    <td valign="top">
        <br></br>
        <a href="javascript:void();" onclick="show_hide('col{position()}')">
        <xsl:value-of select="@nodeName"/></a>

    </td>
</tr>

<tr >
    <td id="col{position()}">
    <xsl:value-of select="data [@alias = 'CareerPosition']" disable-output-escaping="yes"/>
    </td>
</tr>
</xsl:for-each>

</table>


Morten Bock - Level 2 certified - MVP 2008/2009 - My danish blog with a few english posts

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.