?
Solved

Hide field when it has no value

Posted on 2007-12-07
2
Medium Priority
?
720 Views
Last Modified: 2013-11-18
Experts,

On our sharepoint intranet site we changed the XSL of the people searh results like this:

        <font color="#FF6633">Title: </font>
        <xsl:if test='string-length($title) &gt; 0'>
         <xsl:value-of select="$title" /><br />
        </xsl:if>

        <font color="#FF6633">Department: </font>
        <xsl:if test='string-length($dep) &gt; 0'>
         <xsl:value-of select="$dep" /> <br />
        </xsl:if>

        <font color="#FF6633">Office Nr.: </font>
        <xsl:if test='string-length($phone) &gt; 0'>
         <xsl:value-of select="$phone" /><br />
        </xsl:if>

But when a user eg. does not have an office nr, the word "Office Nr.:" is still visible, how can I hide it when it has no value

thx in advance
0
Comment
Question by:ITBenelux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
R7AF earned 1200 total points
ID: 20426876
How about including the text in the xsl-if?
<xsl:if test='string-length($phone) &gt; 0'>
         <font color="#FF6633">Office Nr.: </font>
         <xsl:value-of select="$phone" /><br />
</xsl:if>

Open in new window

0
 
LVL 1

Author Comment

by:ITBenelux
ID: 20426903
Simple :-) you just need to know it.... thank for the quick answer. !
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question