Skip to main content
Participating Frequently
January 5, 2024
Question

Changing background colour of combobox in pdf

  • January 5, 2024
  • 1 reply
  • 327 views

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, 

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
January 5, 2024

Scripts are not entirely supported in some browsers.