Highlighted

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

Highlighted

Avatar

Avatar

_Bill_Bain_

Avatar

_Bill_Bain_

_Bill_Bain_

16-12-2008

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

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

16-12-2008

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

Avatar

Avatar

Mark_Lindberg

Avatar

Mark_Lindberg

Mark_Lindberg

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