• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

event.target.multiline

New Here ,
Dec 19, 2022 Dec 19, 2022

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?

 

 

TOPICS
JavaScript , PDF forms

Views

509

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 19, 2022 Dec 19, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 19, 2022 Dec 19, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2022 Dec 19, 2022

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 19, 2022 Dec 19, 2022

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?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2022 Dec 19, 2022

Copy link to clipboard

Copied

LATEST

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;

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 19, 2022 Dec 19, 2022

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines