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

Changing background colour of combobox in pdf

Community Beginner ,
Jan 04, 2024 Jan 04, 2024

Hi guys,

 

Need some help with Javascript in pdf form. 

 

I have the following script for a "combobox31" (with options Yes & No)to change background fill to yellow if the No option is selected. The script is working fine in Nitro pro but not in Microsoft edge or Chrome.

 

I want to make the document compatible with widely available pdf programs like Acrobat, Nitro, Edge and Chrome. Is the following script not supported by Edge and chrome? Is it possible to get  a similar highlighting script which will have better compatibility with more pdf softwares?

 

var v = getField("ComboBox31").valueAsString;
if (v=="Yes") {event.target.fillColor = color.yellow;}
else {event.target.fillColor = color.transparent;}

 

Thanks, 

TOPICS
JavaScript , PDF , PDF forms
251
Translate
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 ,
Jan 04, 2024 Jan 04, 2024
LATEST

Scripts are not entirely supported in some browsers.

Translate
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