Skip to main content
Inspiring
June 18, 2019
Answered

Grab name from text field and email

  • June 18, 2019
  • 1 reply
  • 407 views

Hi,I have a text field called name on a fillable form

The user enters their name  ie:  John Smith

On an email button I would like a javascript code to pull the name from the name text field

and format it john.smith@jet.com.au     the dot between first and last name is important.

This would then auto fill out the to field on the email..

Is this possible ?? there will be no middle names or titles to contend with just first and last name in one text field

Thanks

This topic has been closed for replies.
Correct answer try67

Yes, this is possible. Read this tutorial:

https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

The part you'll need to adjust is this:

var cToAddr = "formsAdmin@BigCorp.com"

To something like this:

var name = this.getField("Name").valueAsString;

var cToAddr = name.replace(" ", ".") + "@jet.com.au";

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 18, 2019

Yes, this is possible. Read this tutorial:

https://acrobatusers.com/tutorials/dynamically-setting-submit-e-mail-address

The part you'll need to adjust is this:

var cToAddr = "formsAdmin@BigCorp.com"

To something like this:

var name = this.getField("Name").valueAsString;

var cToAddr = name.replace(" ", ".") + "@jet.com.au";