Copy link to clipboard
Copied
Hi,
Please would like your help, I'm using the following applied on a dropdownlist:
------------------------------------------------
var nButton = app.alert({
cMsg: "Do you agree to the terms and conditions specified by your user agreement with XYZ Corporation?\n\n If you click No, the document will close.",
cTitle: "Legal Notice",
nIcon: 2,
nType: 2
});
if (nButton === 3) {
this.closeDoc();
}
------------------------------------
I don't know how to customize it to appear when user select a specific value in the list. In addition, if user "agreed" how to unhide a text in the document to show its agreed.
Sorry if its too much but appreciate your great help
First things first. Put the code in the custom validation script for the dropdown.
Surround your code with an "if" block that keys off of the selection that needs to display the message.
if(event.value == "Selection")
{
var nButton = app.alert({
cMsg: "Do you agree to the terms and conditions specified by your user agreement with XYZ Corporation?\n\n If you click No, the document will close.",
cTitle: "Legal Notice",
nIcon: 2,
nType: 2
});
if
...
Copy link to clipboard
Copied
First things first. Put the code in the custom validation script for the dropdown.
Surround your code with an "if" block that keys off of the selection that needs to display the message.
if(event.value == "Selection")
{
var nButton = app.alert({
cMsg: "Do you agree to the terms and conditions specified by your user agreement with XYZ Corporation?\n\n If you click No, the document will close.",
cTitle: "Legal Notice",
nIcon: 2,
nType: 2
});
if (nButton === 3) {
this.closeDoc();
}
Copy link to clipboard
Copied
Thanks a lot, this works :))))
How to show the hidden text now after the user agreed? is that possible? (basically the text to confirm the choice)
Sorry for many questions 🙂
Copy link to clipboard
Copied
Where is the hidden text? Is it in a text field or text annotation?
Copy link to clipboard
Copied
Thanks @Thom Parker its a text field to confirm the choice of the user
Copy link to clipboard
Copied
Just unhide the field based on the button choice.
Here's an article on the topic:
https://www.pdfscripting.com/public/Hiding-and-Showing-Form-Fields.cfm
this.getField("PopupText").display = (nButton == 4)?display.visible:display.hidden;
Copy link to clipboard
Copied
Thanks alot 🙂