Copy link to clipboard
Copied
Gday,
I am creating a new form using Acrobat Pro DC (Version 2015.006.30119) and i want to select a name from a dropdown box i have created and have it pre-populate a text field to show their phone number so the user doesnt have to look it up or enter it manually.
Can someone please help me with this? Please note i do not speak code so if you can provide dumb down steps its much appreciated.
Copy link to clipboard
Copied
This requires using a script.
The easiest way to set it up is to add the phone number as the export value of each of the items in your drop-down.
If you do that the only thing you'll need is to enter the following code as the custom calculation script of the text field:
event.value = this.getField("Name").value;
I'm assuming above that the drop-down is called "Name".
You might also want to tick the option to commit the selected value of the drop-down immediately. You'll find that under its Properties, Options tab.
Copy link to clipboard
Copied
This requires using a script.
The easiest way to set it up is to add the phone number as the export value of each of the items in your drop-down.
If you do that the only thing you'll need is to enter the following code as the custom calculation script of the text field:
event.value = this.getField("Name").value;
I'm assuming above that the drop-down is called "Name".
You might also want to tick the option to commit the selected value of the drop-down immediately. You'll find that under its Properties, Options tab.
Copy link to clipboard
Copied
Hi,
I am having a similar issue, but I am not able to set the export values of the dropdown as the values in the dropdown are dependent on the selections from another dropdown. Is there a way I can add to the below, but have it run an IF statement of some sort to tell it to output a number when a name is populated?
event.value = this.getField("Name").value;
Thank you!
Copy link to clipboard
Copied
Has something changed with Adobe where this won't work anymore. I have tried so many times to get this to work and it doesn't populate the Text Field with the requested value. I have tried different field names and no go. I have been playing with Adobe for so long I am getting so tired of it not working.
Copy link to clipboard
Copied
No, not really. Could you share the file in question where it's not working?
Copy link to clipboard
Copied
I have tried several different options from different adobe commuity people and none seem to work. To give you a heads up I start in Microsoft Word creating form and then convert to adobe pdf where I then go into Adobe Acrobat DC. I prepare form and add fields. In the DROPDOWN TEST below I enter into dropdown field {Calculate} with:
var f = this.getField("Text"); //change text field name as needed
var v = event.value;
f.value = v;
And it doesn't prepopulate the Text field.
I have used different coding from the different employees and can't get it to work. I'm sure its how I am doing it or not doing it. Adobe has been very frustrating for me. Thanks of looking into it.
Copy link to clipboard
Copied
Oh when showing my process after enter all my fields I then convert to Adobe Sign.
Copy link to clipboard
Copied
You can either have scripts, or you can have an Adobe Sign form, but not both.
Copy link to clipboard
Copied
First step would be to revert it to an Acrobat form.
Copy link to clipboard
Copied
Sorry, here you go.
Copy link to clipboard
Copied
I missed one of your responses. You mentioned I can either have scripts, or you can have an Adobe Sign form, but not both. Well I use adobe sign forms to send out different forms. Through Adobe Acrobat DC can I send several forms "together" so that I can use the scripts option? Or is there something I have to do in Adobe Sign to get the scripting idea, or outcome, I want to accomplish?
Copy link to clipboard
Copied
You can use Acrobat's Distribute command to do it, or simply attach the file to an email and send it to the recipients. You can add to it a button so that it can be submitted back to you, when filled in.
If you want the users to sign it, add a (required) digital signature field.
Copy link to clipboard
Copied
Thank you Try67 I will give that a try.
Copy link to clipboard
Copied
Try67 I was able to send a form and the dropdown populated the text field as asked which is awesome. I haven't tried sending any combined forms though. I will.
But I just don't like how it all goes and the professionalism about it being "Adobe" and all. I wanted to do this all through Adobe Sign which I why I pay for it. I just find it hard to understand that Adobe Sign can't seem to do what I am asking.
Thanks for the help Try67.
Copy link to clipboard
Copied
Hi! I am working on a form that on the first page has a dropdown with three options, and depending on the selected option, I want to code the form to pre-populate information on the third page of the form. The information will vary depending on the selected option, and should be pre-populated into eight different fields. The code that I have is this:
var v = this.getField("Campus").value
if (v == " A")
{
getField("PTELegalAddress").value = "University sample\nDepartment Sample\nStreet sample\nState sample";
getField("PTECentralEmail").value = "abc@university.edu";
getField("PTEACName").value = "Name sample";
getField("[PTEACPhone").value = "phone sample";
getField("PTEAOName").value = "fixed value sample";
getField("PTEAOEmail").value = "email sample ";
getField("PTEAOPhone").value = "phone sample";
getField("PTEInvoiceAdress").value = " University sample\nDepartment Sample\nStreet sample\nState sample ";
this.getField("PTELegalAddress").display = display.visible;
this.getField("PTECentralEmail").display = display.visible;
this.getField("PTEACName").display = display.visible;
this.getField("PTEACPhone").display = display.visible;
this.getField("PTEAOName").display = display.visible;
this.getField("PTEAOEmail").display = display.visible;
this.getField("PTEAOPhone").display = display.visible;
this.getField("PTEInvoiceAddress").display = display.visible;
}
I have coded this into a 'run' button, but it is not working. Can you help me, please?
Thanks in advance!
Copy link to clipboard
Copied
The code seems fine. Are there any error messages in the JS Console when you use it?
Copy link to clipboard
Copied
none 😞
when I 'click' the button to run the scrip nothing happens on the third tab, and I would expect to see the field pre-populated
Copy link to clipboard
Copied
@try67 I found the problem!! it was the 'appearance' of the address field because the code includes new lines and the field was "autofill"
oh the joys of coding!
Copy link to clipboard
Copied
Not sure what you mean, but glad to hear it's sorted!

