-
Jan 12th, 2017, 06:20 AM
#1
Thread Starter
Addicted Member
Acrobat Pro: adding text to textboxes based on dropbox choice
I would like to know if anyone can help me on the following problem?
I found a code for this, but this is not working as i thought i would do.
https://acrobatusers.com/tutorials/change_another_field
And change the code to the following.
Code:
// Place all pre-population data into a single data structure
var KomData1= this.getfield ("DocumentnrRow1").valueAsString;
var KomData2= this.getfield ("DocumentnrRow2").valueAsString;
var komdata = { KomData1:{ Title: "Title-1",
Rev: "Rev-1"},
KomData2:{ Title: "Title-2",
Rev: "Rev-2"}};
function SetFieldValues(cKom)
{
// Populate fields with values from the Department Data Object
this.getField("Kom-DocT-1").value = komdata[cKom].Title;
this.getField("Kom-DocREV-1").value = komdata[cKom].Rev;
However when i do this nothing happens. I have 2 froms in the document 1 with only textboxes the other with 1 dropdownbox and 2 textboxes.
I would like to be able to make a choice in the dropdownbox and fill the according textboxes.
-
Jan 13th, 2017, 07:47 AM
#2
Thread Starter
Addicted Member
Re: Acrobat Pro: adding text to textboxes based on dropbox choice
No one?.
My knowledge of Acrobare Pro Java is quite small. I think it should be something like this. However this doesn't work in Java.
Code:
If dropdownDoc1.text=DocumentnrTXT.text then
TitleTXT.text=TextboxTitle1.text
RevTXT.text=TextboxRev1.text
else ....
The following code doesn't do exactly what i need.
Code:
if(this.getField("dropdownDoc").value == " ") {
event.value = "";
}
else if (this.getField("dropdownDoc").value == "DocumentnrTXT1")
{event.value = this.getField("TitleTXT1").valueasstring;
}
else if (this.getField("dropdownDoc").value == "DocumentnrTXT2")
{event.value = this.getField("TitleTXT2").valuevalueasstring;
}
The problem is that it show the value from the dropdownbox and not the textbox as i expected it to do.
Last edited by rakker; Jan 15th, 2017 at 03:23 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|