Highlighted

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

New Here ,
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!!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
iOS

Views

588

Likes

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

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

New Here ,
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!!

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

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.

TOPICS
iOS

Views

589

Likes

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
Aug 10, 2017 0
Most Valuable Participant ,
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.

Likes

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
Reply
Loading...
Aug 10, 2017 0
New Here ,
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.

Likes

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
Reply
Loading...
Aug 10, 2017 0
Most Valuable Participant ,
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.

Likes

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
Reply
Loading...
Aug 10, 2017 1
New Here ,
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?

Likes

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
Reply
Loading...
Aug 11, 2017 0
try67 LATEST
Most Valuable Participant ,
Aug 11, 2017

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Aug 11, 2017 0