These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to autofill an e-mail when user inputs userid?

mikeyb
Registered: Sep 4 2011
Posts: 20
Answered

Hi all
 
Is it possible to make Acrobat to automatically copy the data just typed in a text-field and duplicate it in another text-field?
 
I want to take a userid that a user just typed in a textfield and make Acrobat copy that in a text-field below. Pluss that it has to add the follow text: @gmail.com
 
Example:
 
Textfield A: _____________
Textfield B: _____________ [at] gmail [dot] com
 
User types in "test" and it ends up like this:
Textfield A: test
Textfield B: test [at] gmail [dot] com
 

My Product Information:
Acrobat Pro 10.1, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1875
Accepted Answer
Yes, but exactly how you do this depends on how you want it to behave. For example, you could use the following code as the custom Validate script for the first field;

// Custom Validate script for Textfield A

// Get the email address field
var f = getField("email");

// Set the email address field if it's empty
if (!f.valueAsString) f.value = event.value + "@gmail.com";



Change "email" in the code above to whatever you're using for the name of the email address field.
mikeyb
Registered: Sep 4 2011
Posts: 20
Works like a charm, thank you sir!