Skip to main content
November 25, 2025
Answered

Script for creating an email in another textbox

Hi all,

 

I'm looking to create this situation in two separate textboxes:

Input - BoxA: "JOHN SMITH"

Output - BoxB: "JSMITH@EMAIL.COM"

 

is this possible?

PDF Automation Station
Community Expert
November 25, 2025

Enter the following custom calculation script in BoxB:

event.value="";
var name=this.getField("BoxA").value;
if(name && name.split(" ").length>1)
{event.value=name.split("")[0]+name.split(" ")[1]+"@email.com"};

9 replies

try67
Community Expert
Community Expert
November 25, 2025

What about if there are multiple names? You can't know if they are first names, middle names, last names, etc.? What about initials? What about hyphenated names? There are many variables you didn't consider with this, I think.

Translate
November 26, 2025

For someone else, I can absolutely understand where those factors need to be considered. However, for me, I got exactly what I needed it to be.

Translate
PDF Automation Station
Community Expert
Community Expert
November 26, 2025

Another way to do this (if there is a set list of names and corresponding email addresses) is to have a dropdown containing the list of names, with email addresses as the corresponding export values.

Translate
JR Boulay
Community Expert
Community Expert
November 25, 2025

Use this as a Validation script in BoxA:

if (event.value != "") {this.getField("BoxB").value = event.value + "@email.com";}
else {this.getField("BoxB").value = "";}
Translate
Acrobate du PDF, InDesigner et Photoshopographe
November 25, 2025

This is what I'm getting, so not quite what I'm looking for.

866098i0DFAE7616577B585.png

 

I need the first letter of the first word in BoxA and the entire second word in BoxA.

Translate
PDF Automation Station
Community Expert
Community Expert
November 25, 2025

Enter the following custom calculation script in BoxB:

event.value="";
var name=this.getField("BoxA").value;
if(name && name.split(" ").length>1)
{event.value=name.split("")[0]+name.split(" ")[1]+"@email.com"};
Translate
PDF Automation Station
Community Expert
Community Expert
November 25, 2025

What do you mean by "Output"?

Translate
November 25, 2025

After the script or formula, that is what I'd like to appear in BoxB.

Translate