title: JavaScript: Build email address from two strings (first name and last name)
body: <p>I am attempting a JavaScript in Adobe Acrobat to populate the email address (field: Email) based on the first name (field: FirstName) and last name (field: LastName) entered. Every email address will have the same domain (@company.com). </p>
  
  <p>I found many resources on doing the opposite (to determine first and last name from email address) but  haven't found how to do this. I'm sure it's simple but I have not been using JavaScript very long. </p>
  
  <p>This is getting me close:</p>
  
  <pre><code>//Populate requestor's email address based on requestor's name
  
  //Email Address Object
  
  var address = {
      "firstName":"FirstName",
      "lastName": "LastName"
  }
  
  
  //Email Address Function
  function SetFieldValues (firstName, lastName) {
      this.getField("Email").value=address.firstName+"."+address.lastName+"@company.com"
  }
  </code></pre>
  
  <p>My email address output is then </p>
  
  <pre><code>FirstName.LastName@company.com
  </code></pre>
  
  <p>I know that I have defined firstName and lastName as strings and that's the reason they are coming up in the output, but I am not sure how to have address change firstName and lastName based on what is entered into the fields on the form.</p>