Skip to main content
Known Participant
Jun 13, 2025 3:24 AM UTC
Answered

Checkbox style

Is there a way to change checkbox style with a script?

Nesa Nurani
Nesa NuraniCorrect answer
Community Expert
Jun 29, 2025 2:21 PM UTC

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];

 

3 replies

Nesa Nurani
Community Expert
Community Expert
Jun 13, 2025 3:26 AM UTC

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;

Translate
MarietaaAuthor
Known Participant
Jun 29, 2025 2:18 PM UTC

Thanks, I have an additional question, let's say I want to cycle through 3 styles with a button, is that possible?

Translate
Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
Jun 29, 2025 2:21 PM UTC

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];

 

Translate