Skip to main content
Participant
April 16, 2021
Question

CHANGING COLOUR OF TEXT BOXES

  • April 16, 2021
  • 2 replies
  • 361 views

I have approximately 40 text boxes in one file that need to be changed from black to red.  Is it possible to automate this process, for example a repeat function?  

This topic has been closed for replies.

2 replies

Bernd Alheit
Community Expert
Community Expert
April 16, 2021

Are this form text fields?

BarlaeDC
Community Expert
Community Expert
April 16, 2021

Hi,

 


for (var i =0; i < this.numFields; i++){
  var curField = this.getField ( this.getNthFieldName(i));
  if ( curField.type == "text"){
    curField.fillColor = color.red;
  }
}

The code above should do the trick, although I wrote it from the hip so have not been able to test it, if it is a one time thing you can run it from the console.