Copy link to clipboard
Copied
I have a PDF document with mostly text and some images and would like to create buttons for the various sections of the document that trigger text fields to pop up and provide explanatory info about the individual sections when users click on the buttons.
Is there a way to do this? I've looked at buttons and their settings but haven't been able to figure it out.
Thank you!
Copy link to clipboard
Copied
You could use alert pop for that, as 'Mouse UP' action of a button select 'Run a JavaScript' and add this script:
app.alert("This is the explanatory information for this section.", 3);
Copy link to clipboard
Copied
Cool, yeah that could probably work for me. The title of the window that pops up is "Warning: JavaScript-Window". Do you happen to know if there's a way to change that text?
Copy link to clipboard
Copied
To remove warning you need to run script from privileged context like installing script on your machine (PC) which is not helpful if PDF will be used by other users (they would need to do the same).
You could also create a hidden text field with your message and show/hide it using the button, or use buttons tooltip to show message while mouse hover over button.
Copy link to clipboard
Copied
That sounds like an even better idea, I'll try to figure out how to do that. Thank you!
Copy link to clipboard
Copied
Hmmm I don't seem to be able to figure out how to do this. I have created a text field with an example text. I have created a button. However, I cannot figure out how to (a) make the text field hidden and (b) how to make the button interact with the text field. I can see that one action that the button can trigger is "show/hide field" but there seems to be no way to select the text field for this action. Help would be greatly appreciated, thank you 🙂
Copy link to clipboard
Copied
When you select show/hide, click on 'add' and then you will be able to select text field.
Or use this script as 'Mouse UP' action of a button:
var f = this.getField("Text1");
f.display = (f.display == display.hidden)? display.visible : display.hidden;
Change "Text1" to the name of your text field.
Copy link to clipboard
Copied
Thank you so much for your reply but it's still not working. I did try clicking "add" but the only thing I can select for adding is the button itself. Nothing else shows up in the list.
I wanted to try your suggestion with JavaScript but how do I know the name of my text field? I added a text field to the document but I can't find any option for naming the text field or accessing any kind of properties about it. All I can do is move it around and change the text written in the field.
Copy link to clipboard
Copied
Can you share your file with us?
Copy link to clipboard
Copied
Unfortunately I can't, but with the help of a colleague I was able to replicate the steps shown in this video:
https://www.youtube.com/watch?v=TZpmM3Fbqcg
Anyway, thank you so much for your help 🙂