Copy link to clipboard
Copied
Please help.
I have a conditional formating of a text field depending on whether a check box is checked or not.
The code works fine when the form is used in Acrobat but not when the form is opened in a web browser or iPad.
this is the code:
if (getField("15").value=="Yes") {
event.target.multiline = false;
event.target.alignment = "center"
event.value = "N/A";
}
else {
event.target.multiline = true;// Make it multiline=ON
event.target.alignment = "left"
}
Can anyone please advise?
Copy link to clipboard
Copied
Web browsers and non-Windows/Mac PDF viewers and anything except Acrobat/Reader have severe limitations. Unlikely there is an alternative.
Copy link to clipboard
Copied
Thank you for the quick reply!
I am opening the form with the offical Acrobat Reader on the iPad and it is still not working. Is there another code i can use to make the text appear centralized when a check box is checked
Copy link to clipboard
Copied
Don't count on any scripts working in any mobile version of Reader, unfortunately.
For best results (on an iOS device) try PDF Expert by Readdle.
Copy link to clipboard
Copied
I am no expert on using javacodes, but would thier be another code instead of the event.target.multiline that is more compatible with the event iPad adobe app?
Copy link to clipboard
Copied
There's no other way to change this property of a field, if that's what you're referring to.
Only thing you can try is to access the field directly, instead of via event.target, like this:
this.getField("FieldName").readonly = false;
Copy link to clipboard
Copied
Acrobat Reader on iOS is a big disappointment for form creators. Adobe obviously have no interest in making it better because they have had over a decade to do it. Here is the Adobe guide to JavaScript on iOS. It is very short: https://www.adobe.com/devnet-docs/acrobatetk/tools/Mobile/iosapi/index.html