These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Do no display "Null"

alexven
Registered: Apr 1 2011
Posts: 1

Hi Guys,
 
Simple question for all you advanced programmers. How do I stop "Null" being displayed as a result of the following javascript if the field is empty? If there is no value I want nothing to be displayed.
 
Thanks in advance!
 
web.rawValue + "abn=" + abn.rawValue + "&company_name=" + company_name.rawValue;
   
Alex V

My Product Information:
LiveCycle Designer, Windows
DaveyB
Registered: Dec 10 2010
Posts: 70
alexven wrote:
web.rawValue + "abn=" + abn.rawValue + "&company_name=" + company_name.rawValue;
Since your return value is a string, simply add a zero length string at the beginning or the end:

+ ""

This will force a return of type string, zero length, instead of returning nothing which results in the 'null' value. A better alternative would be to prepopulate "company_name" with "" :

dim &company_name = "";Then check your input fields for a null value and only assign the value to the variable if the input field is not null.

Hope that helps!

DaveyB

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

lcp30
Registered: Apr 12 2011
Posts: 1
what I am trying to find out is if my java scrip work i have been having trouble with it here it is
Anxiety child disorder social
Social Anxiety disorder child
Generalized antiety in disorder
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
I do not directly see you PDF form. It appears you are advertising your a psychological consoling service.

George Kaiser