Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Make a "null" value white?

Avatar

Not applicable
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

Level 10
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 = ""