5 Replies Latest reply on Jan 24, 2016 7:51 AM by gkaiseril

    Set value of a field per entry on another fields...




      On a form following fields are defined: 


      1. LName
      2. FName
      3. PartPtemail
      4. PartPortalPtName  Read Only
      5. NonPartPortalPtName  Read Only


      LName, FName are filled always, if Nothing was entered on PartPtemail then I want, LName and FName to be concatenated and filled into NonPartPortalPtName and set PartPoralPtName to blank, but if email was entered into PartPtemail , then I want to concatenate LName, FName into PartPortalPtName and set the NonPartPoralPtName.


      I wrote the following and put it as Custom Calculation Script “Calculate” tab on field PartPoralPtName but somehow cannot get it work properly.

      // Get the field values, as strings
      var s2 = getField("LName").valueAsString;
      var s1 = getField("FName").valueAsString;
      // Combine values, separated by a space
      if (getField("PartPtemail").value.trim() == "")
        { PartPortalPtName.value = ""; }
        { event.value = s2 + ", " + s1; };