re dynamic drop down

  • Thread starter timothy ma and constance lee
  • Start date
T

timothy ma and constance lee

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

Joris Gillis

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

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top