0

I am trying to conditionally reveal/hide rows in a custom edit form in SharePoint Designer 2010. I am using xsl's starts-with test, but I am not managing to have it work. It only hides the row, even when the condition is true.

Here is the code in question:

<table>
   <xsl:if test="starts-with(@DMR_x0020_Type, '1')">
      <tr>
         <td width="100%"><h1>111</h1></td>
         <td />
      </tr>
   </xsl:if>
   <xsl:if test="starts-with(@DMR_x0020_Type, '2')">
      <tr>
         <td width="100%"><h1>211</h1></td>
         <td />
      </tr>
   </xsl:if>
   <xsl:if test="starts-with(@DMR_x0020_Type, '3')">
      <tr>
         <td width="100%"><h1>311</h1></td>
         <td />
      </tr>
   </xsl:if>
   <xsl:if test="starts-with(@DMR_x0020_Type, '4')">
      <tr>
         <td width="100%"><h1>411</h1></td>
         <td />
      </tr>
   </xsl:if>
   <tr>
      <td width="100%"><h1>X11</h1></td>
      <td></td>
   </tr>

Regardless of whether the condition is true or false (and I get to preview whether it is considered true or false in the conditional formatting side-bar), it hides the value. The only thing showing is the final row with X11.

I feel that it should be obvious but that I'm missing it because I'm a newb. What am I missing?

Thanks for any help/advice that folks can offer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.