6 Replies Latest reply on Nov 19, 2015 12:54 PM by bfry2461

    Calculating Text Fields

    bfry2461

      I found a javascript to combine 2 text fields and it works the way I want it to.

       

      But I want to add another command and not sure how to do that.  There is the script:

       

      // Get the field values, as strings

      var s1 = getField("First Name").valueAsString;

      var s2 = getField("Last Name").valueAsString;

       

      // Combine values, separated by a period

      if (s3 = 1) {

      event.value = s1 + "." + s2 + "@domain.com";}

       

      So basically, this will take the first and last name fields and combine them with the domain address to create a users email address.

       

      If front of the address field on the form, there is a check box, to be checked if an email address is required.  So I am looking for I guess an IF statement that if the Company e-Mail check box is checked, then the above script runs.  I am not sure how to do that.  Or hide the . @domain.com if not used.

       

      I'd appreciate any assistance.