Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
<xsl:variable name="Year" select="umbraco.library:RequestQueryString('Year')"/>I can get this paramter now i wantto assign the value in dropdownlist if there is value or else wil not assign The selected value in XSLT file
<select name="mylist" id="DropNewsYear" OnChange="location='{umbraco.library:NiceUrl($currentPage/@id)}?Year='+getSelect(this)" >
<option selected="selected" value="ChooseYear">Choose Year</option> <option value="2011">2011</option> <option value="2010">2010</option> <option value="2009">2009</option> <option value="2008">2008</option> <option value="2007">2007</option> <option value="2006">2006</option> <option value="2004">2005</option> <option value="2004">2004</option> </select>
any Code example wil be useful
If I understand you correct something like this should work:
<option value="{$Year}"><xsl:value-of select="$Year" /></option>
/Kim A
If you mean to mark the year in the querystring as the selected value in the dropdown then you can do this.
<xsl:variable name="Year" select="umbraco.library:RequestQueryString('Year')"/> <xsl:for-each select="/list/of/years"> <option value="{.}"> <xsl:if test=". = $Year"> <xsl:attribute name="selected">selected</xsl:attribute> </xsl:if> <xsl:value-of select="."> </option> </xsl:for-each>
<OPTION>
<xsl:if test="$value = ./@value">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:attribute name="value"><xsl:value-of select="./@value" /></xsl:attribute>
<xsl:value-of select="." />
</OPTION>
e.g. <option value=1>One</option>
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
assign a selected Value in xslt from xsl vriable
<xsl:variable name="Year" select="umbraco.library:RequestQueryString('Year')"/>
I can get this paramter now i wantto assign the value in dropdownlist if there is value or else wil not assign The selected value in XSLT file
<select name="mylist" id="DropNewsYear" OnChange="location='{umbraco.library:NiceUrl($currentPage/@id)}?Year='+getSelect(this)" >
<option selected="selected" value="ChooseYear">Choose Year</option>
<option value="2011">2011</option>
<option value="2010">2010</option>
<option value="2009">2009</option>
<option value="2008">2008</option>
<option value="2007">2007</option>
<option value="2006">2006</option>
<option value="2004">2005</option>
<option value="2004">2004</option>
</select>
any Code example wil be useful
If I understand you correct something like this should work:
/Kim A
If you mean to mark the year in the querystring as the selected value in the dropdown then you can do this.
<OPTION>
<xsl:if test="$value = ./@value">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:attribute name="value"><xsl:value-of select="./@value" /></xsl:attribute>
<xsl:value-of select="." />
</OPTION>
e.g. <option value=1>One</option>
is working on a reply...