Radio Button Calculations in Adobe LiveCyle Designer ES 4®

This tutorial shows how to leverage radio button values to make forms that can calculate based on user input.  Simple JavaScript concepts like parsing string to numeric values is also covered.

Scripts used in this tutorial:

this.rawValue = parseInt(Question1.rawValue) + parseInt(Question2.rawValue) + parseInt(Question3.rawValue) + parseInt(Question4.rawValue);

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.

HTML Snippets Powered By : XYZScripts.com