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
BedrockMission!

Learn More

View all

Sign in to view all badges

Make a "null" value white?

Avatar

16-12-2008

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.

Replies

Avatar

Avatar
Level 4
_Bill_Bain_
Level 4

Likes

0 likes

Total Posts

79 posts

Correct Reply

0 solutions
View profile

Avatar
Level 4
_Bill_Bain_
Level 4

Likes

0 likes

Total Posts

79 posts

Correct Reply

0 solutions
View profile
_Bill_Bain_
Level 4

16-12-2008

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

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

16-12-2008

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

Avatar

Avatar
Validate 1
Level 4
Mark_Lindberg
Level 4

Likes

8 likes

Total Posts

211 posts

Correct Reply

7 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 4
Mark_Lindberg
Level 4

Likes

8 likes

Total Posts

211 posts

Correct Reply

7 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
Mark_Lindberg
Level 4

16-12-2008

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

else TextField13.rawValue = ""