Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom 713 posts 954 karma points
    Jun 10, 2011 @ 05:50
    Tom
    0

    IF CheckBoxList Contains?

    is there any easy way to find out if a checkbox list contains a value? rather than looping over the selected values on the datatype do more of something like?

    <xsl:variable name="selectedValues" select="$currentPage/myList"/>
    <xsl:if test="$selectedValues contains 'moo'">do something</xsl:if>
  • Lee Kelleher 4025 posts 15835 karma points MVP 13x admin c-trib
    Jul 13, 2011 @ 19:13
    Lee Kelleher
    1

    Hi Tom,

    You've probably already figured this out... but you were so close anyway!  There is an XPath function called "contains":

    <xsl:if test="contains($selectedValues, 'moo')"> do something </xsl:if>

    Cheers, Lee.

  • Tom 713 posts 954 karma points
    Jul 14, 2011 @ 00:30
    Tom
    0

    Hi Lee,

    Thanks for the reply! yes I ended up working that out finally! haha

    between trying to get on top of razor and still supporting xslt it has been busy!

Please Sign in or register to post replies

Write your reply to:

Draft