Copy link to clipboard
Copied
I have a form with a Yes check box and a No check box.
When the user checks No, I would like the text box beside it to autopopulate to read "Not Applicable".
When the user checks Yes, I would like the text box to be free flow text entry.
I am stuck on the javascript to accomplish this. Also, does the script go into the properties of the checkbox or into the text box?
Using Adobe Acrobat X Standard
To get started read this article:
https://www.pdfscripting.com/public/How-to-write-an-If-statement.cfm
Basically, you want to use the MouseUp action to run a script that will set the value of the text field when checked, and make it read only, but when uncheck, clear the field and make it not readonly.
var oTxtFld = this.getFeild("TextField");
if(event.target.value == "Off")
{//Unchecked
oTxtFld.readonly = false;
oTxtFld.value = "";
}
else
{
oTxtFld.readonly = true;
oTxt
...Copy link to clipboard
Copied
To get started read this article:
https://www.pdfscripting.com/public/How-to-write-an-If-statement.cfm
Basically, you want to use the MouseUp action to run a script that will set the value of the text field when checked, and make it read only, but when uncheck, clear the field and make it not readonly.
var oTxtFld = this.getFeild("TextField");
if(event.target.value == "Off")
{//Unchecked
oTxtFld.readonly = false;
oTxtFld.value = "";
}
else
{
oTxtFld.readonly = true;
oTxtFld.value = "Not Applicable";
}
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more