re dynamic drop down

Joined
Jul 21, 2004
Messages
57
Reaction score
0
I try to generate the drop down using

<xsl:template name="generateDropdown">

<xsl:param name="length" />

<xsl:if test="$length &gt; 0">

<option value="{$length}"><xsl:value-of

select="$length" /></option>

<xsl:call-template name="generateDropdown">

<xsl:with-param name="length" select="$length -

1"/>

</xsl:call-template>

</xsl:if>

</xsl:template>

Can I generate it from ascending order?
 

Joris Gillis

Usenet Archive
Joined
Sep 28, 2004
Messages
355
Reaction score
0
Can I generate it from ascending order?

use this:

<xsl:template name="generateDropdown">
<xsl:param name="length" />
<xsl:param name="count" select="$length"/>
<xsl:if test="$length &gt; 0">
<option value="{$count - $length + 1}"><xsl:value-of select="$count - $length +1" /></option> <xsl:call-template name="generateDropdown"> <xsl:with-param name="length" select="$length -1"/> <xsl:with-param name="count" select="$count"/> </xsl:call-template> </xsl:if> </xsl:template>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top