Copied to clipboard

Flag this post as spam?

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


  • René 327 posts 852 karma points
    Oct 27, 2013 @ 12:23
    René
    0

    Contour - get values from checkbox list

    HI 

    Umbraco v6.1.6 (Assembly version: 1.0.5021.24867) - Umbraco Contour version 3.0.17

    How do i get the value from the checkbox list in comtour.

    I have theis in a "XSLT transformed email"

    <ul>        
              <xsl:for-each select="$records//fields/child::*">
                <xsl:if test="string-length(string(.//value)) &gt; 0">
                  <li>
                      <h4><xsl:value-of select="./caption"/></h4>
                      <p>
                        <xsl:value-of select=".//value"/>
                      </p>
                  </li>
                  </xsl:if>
              </xsl:for-each>
        </ul>

    I only get the first value from a Checkbox List.

    I have tryed this :

    <ul>
            <li>        
              <xsl:for-each select="$records//fields/child::* [caption[1] = 'Vælg 2 moduler fra listen']/values/value">
                <h4><xsl:value-of select="./caption"/></h4>
                <xsl:value-of select="."/>,
              </xsl:for-each>
            </li>
              <xsl:for-each select="$records//fields/child::*">
                <xsl:if test="string-length(string(.//value)) &gt; 0">
                  <li>
                      <h4><xsl:value-of select="./caption"/></h4>
                      <p>
                        <xsl:value-of select=".//value"/>
                      </p>
                  </li>
                  </xsl:if>
              </xsl:for-each>
        </ul>
    

    Is there any "right" way to get the values from the checkbox list. 

    It should be listet in the same order as on the form.

    Here is an image of the form

    René

  • René 327 posts 852 karma points
    Oct 27, 2013 @ 14:25
    René
    1

    HI 

    Got it working

    <ul>
          <li>
              <h4>Moduler der er valgt</h4>
                <xsl:for-each select="$records//fields/child::* [caption[1] = 'Vælg 2 moduler fra listen']/values/value">
                  <p>
                    <xsl:value-of select="."/>
                  </p>  
               </xsl:for-each>
            </li>
          <xsl:for-each select="$records//fields/child::* ">
            <xsl:if test="not(contains(caption[1], 'Vælg 2 moduler fra listen'))">
              <xsl:if test="string-length(string(.//value)) &gt; 0">
                <li>
                    <h4><xsl:value-of select="./caption"/></h4>
                    <p>
                      <xsl:value-of select=".//value"/>
                    </p>
                </li>
                </xsl:if>   
              </xsl:if>
          </xsl:for-each>
    </ul>
  • Comment author was deleted

    Oct 29, 2013 @ 16:33

    Thanks for posting the solution :)

Please Sign in or register to post replies

Write your reply to:

Draft