Expand my Community achievements bar.

Make a "null" value white?

Avatar

Former Community Member
I have a field that combines 2 text fields (first and last name) and this field appears on every page. I used the following script to make it work:



form1.#subform[0].TextField13[0]::calculate - (JavaScript, client)

TextField13.rawValue = LastName.rawValue + ", " + FirstName.rawValue



The problem I am running into is that when the LastName and FirstName fields are blank, "null, null" appears in my field. I want people to be able to print blank copies of this form so I need to find a way to hide this.



I have tried changing the font to white if there is a null value but can't get any additional script to work for this field.



How should I attack this problem?



Thanks for any help you can provide.
4 Replies

Avatar

Level 4
If the fields are blank or null, why not change the field's presence to "invisible" or "hidden"?

Avatar

Former Community Member
Just set an initial value of " " (space) in the initial value field.

Avatar

Level 5
You could test the rawvalue of each field (FirstName & LastName), and only compute TextField13 if both are not null -

else TextField13.rawValue = ""