Check for null value in JavaScript

One of my YouTube subscribers recently posted a question related to “bound” data fields.  This reminded me of how data bound fields are often susceptible to being populated with null values if the database is empty.  Here is a little function I wrote to remedy this possibility:

function checkForNull(v_String)
{
 var v_Space = ” “;
 if (v_String == null)
  {
    return v_Space;
  }
else
  {
    return v_String;
  }
}


So, all we are saying here is that if the passed in value (v_String) equals null then return a value of ” ” (one space).  If not, then just return whatever non-null value is there.  This small function is used to “test” the string values of data that is passed from a database to a bound field.

Advanced Master Pages in Adobe LiveCycle ®

Follow up tutorial to Master Page Basics demonstrating more advanced features such as: custom page sizes, header objects that reference form data, and form flow to specific master pages.


Code placed in the ready :  layout event of “FORM.#pageSet[0].Page2.txtCustomer” & “FORM.#pageSet[0].Page2.txtSSN” fields of Master Page 2:
this.rawValue = FORM.Main.txtCustomer.rawValue;

Modified code used in the “FORM.#pageSet[0].Page2.txtSSN” field to carry over the SSN formatting from the Main page:
this.rawValue = FORM.Main.txtSSN.formattedValue;