This project has moved. For the latest updates, please go here.

Hide Textfield if it's empty

Mar 13, 2015 at 10:18 AM
Hey!
I want to hide a text field in DispForm.aspx if the value of this textfield is empty. How can I manage this?

Thank you very much in advance!
Mar 16, 2015 at 8:32 AM
Hello again

This is my code, which isn't workling:

``` var abgemeldetEMAPolizei = SPUtility.GetSPField('EMA / BMA abgemeldet Polizei');
var abgemeldetvalue = abgemeldetEMAPolizei.LabelRow.children().next().text().trim();
if(abgemeldetvalue === null)
{
abgemeldetEMAPolizei.Hide();
}
else
{
abgemeldetEMAPolizei.Show();
}
` Can you help me out here? Thank you!
Mar 16, 2015 at 2:21 PM
Oh - I just found the solution by myself:

the If-Statement should look like this:

if(abgemeldetvalue === "")

Like this it's working.
Marked as answer by MELY on 3/16/2015 at 7:21 AM
Coordinator
Mar 16, 2015 at 7:24 PM
Great I'm glad you got it working! Looks like you're getting the handle of JavaScript :)