Skip to main content
Participant
June 1, 2021
Answered

Changing Check Box Style for entire document

  • June 1, 2021
  • 2 replies
  • 7577 views

I have a very large document with check boxes. There are a total of 63 pages and 565 check boxes. When I convert from Microsoft Word to Adobe PDF, then create a form, I have yet to find a way to tell it that I want these check boxes to default as either "Cross" or "Check" (why is "Square" even an option?). Since I can't have it correct off the bat, I need to go and change every single check box from "Square" to "Check." I have found the most efficient way to do this is per page. That still means I need to go to each page, select all check boxes on that page, and change the Check Box Style properties.

 

Please tell me I'm doing it wrong and there is a quicker/easier way to do this.

Correct answer Nesa Nurani

You need to run this code from javascript console.

Code:

 

for (var i=0; i<this.numFields; i++) {
var fieldt = this.getNthFieldName(i);
if(this.getField(fieldt).type == "checkbox"){
this.getField(fieldt).style = xxx ;}}

 

 Change 'xxx' with style you want.

Styles:

check = style.ch
cross = style.cr
diamond = style.di
circle = style.ci
star = style.st
square = style.sq

2 replies

try67
Community Expert
Community Expert
June 1, 2021

You can do it by running this code from a button or the JS Console:

 

for (var i=0; i<this.numFields; i++) {
	var f = this.getField(this.getNthFieldName(i));
	if (f==null) continue;
	if (f.type=="checkbox") f.style = style.ch;
}
FRUHDAuthor
Participant
June 1, 2021

Thank you so much! 

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
June 1, 2021

You need to run this code from javascript console.

Code:

 

for (var i=0; i<this.numFields; i++) {
var fieldt = this.getNthFieldName(i);
if(this.getField(fieldt).type == "checkbox"){
this.getField(fieldt).style = xxx ;}}

 

 Change 'xxx' with style you want.

Styles:

check = style.ch
cross = style.cr
diamond = style.di
circle = style.ci
star = style.st
square = style.sq

FRUHDAuthor
Participant
June 1, 2021

Thank you!!! I had no idea how to do Java and so this was a first.

I was able to add it into the document, but is there a way to keep it in Adobe so I don't need to do this every time?

try67
Community Expert
Community Expert
June 1, 2021

No, you can't change the default settings used by the Fields Detection Wizard.