Copy link to clipboard
Copied
I need to be able to click on one of these numbers; each number will populate a different text into the text box below. I have read many of the Q & A's here are some are close to what I need, but do not work for my specific issue.
Any help will be greatly appreciated!
Copy link to clipboard
Copied
What you mean to ask is, "I want to populate a text box from a selection in a dropdown field".
Add this code to the custom Validation script for the dropdown.
this.getField("Text11").value = event.value;
Copy link to clipboard
Copied
Thank-you for your answer, it did work. 🙂
However, here is a snippit of a simpler example of what I am trying to do:
I want to make a checkbox like this -
That will populate text and the check on a seperate page to look like this:
So one checkmark needs to populate a checkmark and text.
Does this make sense?
Copy link to clipboard
Copied
You can read about the basics of programming checkboxes and radio buttons here:
https://www.pdfscripting.com/public/Checkboxes-and-Radio-Buttons.cfm
With a checkbox, use the MouseUp action.
if(event.target.value != "Off")
{// Set text and check
this.getField("TextBox").value = "some text";
this.getField("OtherCheck").value = "Yes";
}
else
{// Clear Text and check
this.getField("TextBox").value = "";
this.getField("OtherCheck").value = "No";
}
Be aware that to set a checkbox, the checkbox value must be set to it's Export Value.
Copy link to clipboard
Copied
Hi Tom,
Thank-you so much for your help! I am using Adobe Pro as a part of my comanies contract with Adobe and do not have my own sign on information to access the link that you sent. I have also tried the script above and am not able to make it work; I end up with a checkmark in the box where it is suppose to be, which is good, but I also end up with a checkmark in the spot where I need for my text to go. I am brand new at this and know nothing about scipt or coding, I only need to get through this one project. My appoligies for my lack of abilities!
Copy link to clipboard
Copied
I got it to work!!! Yayyy!!! Thank-you sooooo much!
I may have more questions through out this project. 🙂
Copy link to clipboard
Copied
Another question....
I have this java script modified from what you gave me earlier and it works beautifully for adding the text to one line, However, I need to add this same text to the next 2 lines as well.... please help 🙂
if(event.target.value != "Off")
{// Set text and check
this.getField("Bap 1").value = "See Single Limit"; this.getField("See Single Limit").value = "See Single Limit";
}
else
{// Clear Text and check
this.getField("See Single Limit").value = "";
this.getField("See Single Limit").value = "No";
}
Thank-you so much!
Copy link to clipboard
Copied
Looks like you have the right idea. Repeat the same line that sets the text, but change the field name.
Besides the bad formatting (put separate statements on separate lines), it looks like you need to get the correct field names. Open the "Prepare Form" tools and the field names will be displayed.
These tutorials might help:
https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm
https://www.pdfscripting.com/public/Editing-Fields-Properties.cfm
https://www.pdfscripting.com/public/FreeStuff/AcroForm_Create/AcroForms_Part2g_WhyFieldNames_mp4.cfm
Copy link to clipboard
Copied
Hi Tom,
Thank-you for the info, I was able to populate all 3 lines beautifully!
I am now working on adding text to a text box when multiple checkboxes are marked/selected. I have looked all through the links that you sent and tried several suggested options, but nothing is working for me. (this is why I do not make my living as a code specialist!)
I need for these boxes in Red :
to add text to this box below all at the same time if selected; or only a few if selected.
I will be doing this same thing from drop down boxes once I have this part with the checkmarks completed.
Thanks again so much!
Copy link to clipboard
Copied
Since this is a different topic, please post it to a new thread.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now