if statement in sharpoint 2010 xslt

gogi100 1 Reputation point
2021-03-03T07:10:18.873+00:00

i have a edit form where i need that hide the field 'Потврда за објаву' if value of field 'Статус документа' is 'Документ је одобрен' but my if statement does not woks.
my code is

<tr>

 <td valign="top" class="ms-formlabel" width="190px">
 <H3 class="ms-standardheader"><nobr>Потврда за објаву</nobr></H3>
 </td>
 <td valign="top" class="ms-formbody" width="600px">
 <xsl:variable name="StatusDokumenta" select="@_x0421__x0442__x0430__x0442__x0443__x0441__x0020__x0434__x043e__x043a__x0443__x043c__x0435__x043d__x0442__x0430_" />
<xsl:if test="$StatusDokumenta = 'Документ је одобрен'">


 <SharePoint:FormField runat="server" id="ff26{$Pos}" ControlMode="Edit" FieldName="_x041f__x043e__x0442__x0432__x0440__x0434__x0430__x0020__x0437__x0430__x0020__x043e__x0431__x0458__x0430__x0432__x0443_" __designer:bind="{ddwrt:DataBind('u',concat('ff26',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@_x041f__x043e__x0442__x0432__x0440__x0434__x0430__x0020__x0437__x0430__x0020__x043e__x0431__x0458__x0430__x0432__x0443_')}" /><SharePoint:FieldDescription runat="server" id="ff26description{$Pos}" FieldName="_x0440__x0435__x0432__x0438__x0437__x0438__x0458__x0435_" ControlMode="Edit" />

 </xsl:if>
 </td>

 </tr>
Microsoft 365 and Office SharePoint Server Development
{count} votes

4 answers

Sort by: Most helpful
  1. ZhengyuGuo 10,586 Reputation points Moderator
    2021-03-04T06:17:52.23+00:00

    Please use the script below:

    74208-script.txt

    Add script in SharePoint Designer 2010 List Edit Form, under PlaceHoderMain tag:

    74209-snipaste-2021-03-04-17-53-05.png
    Thanks
    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. gogi100 1 Reputation point
    2021-03-05T09:05:34.923+00:00

    this script above does not works. when i start developing mode in web browser i receive next picture
    74752-slika.jpg


  3. ZhengyuGuo 10,586 Reputation points Moderator
    2021-03-09T07:54:50.937+00:00

    Hi @gogi100 ,

    As we commented above, I will write a new reply with the latest code for clearificaition:

    75764-74881-interval.png

    75718-updated.txt

    Thanks

    Best Regards


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  4. ZhengyuGuo 10,586 Reputation points Moderator
    2021-03-17T06:31:15.107+00:00

    Hi @gogi100 ,

    Please remember to accept as answer if the question is resolved.

    Thanks
    Best Regards

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.