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

How to change background color through validation script on ipad/ios

New Here ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

Hello,

I am working on a form which we use for recording service visits out in the field. Form fields are drop down boxes with a range of GOOD FAIR and POOR. On the PC my custom validation script runs which changes the background color of the field depending on the selected value. This does not work on iOS devices though. Can someone help me edit the validation code to work within the restrictions of iOS Acrobat Reader App?

if (event.value=="FAIR") 

    event.target.fillColor = color.yellow; 

else if (event.value=="POOR") 

    event.target.fillColor = color.red; 

else if (event.value=="GOOD") 

    event.target.fillColor = color.green; 

else event.target.fillColor = color.white;

I can't seem to find which functions are supported and which are not. I found a developer guide which suggested that event and target classes are supported, but no mention of fillColor.

Thanks!!

TOPICS
iOS

Views

1.3K

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
1 ACCEPTED SOLUTION
Community Expert ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

Try other properties, like the text color or the stroke color. Maybe you'll luck out.

By the way, the app that has the most support for scripts on iOS devices is PDF Expert by Readdle, not Adobe Acrobat/Reader.

View solution in original post

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 ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

I can't seem to find which functions are supported and which are not.

Welcome to the club... Even the documentation that you can find can't always be trusted. It's mostly a matter of trial-and-error. Take into account that the vast majority of things is not going to work on mobile devices at all.

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 ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

Glad to know I'm not the only one...

You would think that something as basic as fillColor would be supported, but... alas. Any suggestion on a work around by chance?I just need to signify any of the fields that are fair or poor.

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 ,
Aug 10, 2017 Aug 10, 2017

Copy link to clipboard

Copied

Try other properties, like the text color or the stroke color. Maybe you'll luck out.

By the way, the app that has the most support for scripts on iOS devices is PDF Expert by Readdle, not Adobe Acrobat/Reader.

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 ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

try67 last question i promise!

Had some limited success with red and green text color changes, ut it seems to not be recognizing "Yellow" as a color. any idea how I can get around this? is there a function to define the color outside of the pre-built ones?

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 ,
Aug 11, 2017 Aug 11, 2017

Copy link to clipboard

Copied

LATEST

My guess would be that it only supports RGB (and maybe gray-scale) colors. The color.yellow constant returns a CMYK value, so that's maybe why it's not working... To specify a custom color use a color array, like this:

["RGB", 1, 1, 0]

Notice the values are between 0 and 1, not 0 and 255 (or 1 and 256) like in other places.

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