Copy link to clipboard
Copied
Is there a way to change checkbox style with a script?
Copy link to clipboard
Copied
Yes,
check - style.ch
cross - style.cr
diamond - style.di
circle - style.ci
star - style.st
square - style.sq
You can use it like this:
this.getField("Check Box1").style = style.sq;
Copy link to clipboard
Copied
Yes, use something like this (it will cycle through check, cross, circle):
var f = this.getField("Check Box1");
var styles = [style.ch, style.cr, style.ci];
var currentIndex = styles.indexOf(f.style);
var nextIndex = (currentIndex + 1) % styles.length;
f.style = styles[nextIndex];
Copy link to clipboard
Copied
Yes,
check - style.ch
cross - style.cr
diamond - style.di
circle - style.ci
star - style.st
square - style.sq
You can use it like this:
this.getField("Check Box1").style = style.sq;
Copy link to clipboard
Copied
Thanks, I have an additional question, let's say I want to cycle through 3 styles with a button, is that possible?
Copy link to clipboard
Copied
Yes, use something like this (it will cycle through check, cross, circle):
var f = this.getField("Check Box1");
var styles = [style.ch, style.cr, style.ci];
var currentIndex = styles.indexOf(f.style);
var nextIndex = (currentIndex + 1) % styles.length;
f.style = styles[nextIndex];
Find more inspiration, events, and resources on the new Adobe Community
Explore Now