Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Checkbox style

Explorer ,
Jun 12, 2025 Jun 12, 2025

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

TOPICS
How to , JavaScript
185
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
2 ACCEPTED SOLUTIONS
Community Expert ,
Jun 12, 2025 Jun 12, 2025

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;

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2025 Jun 29, 2025
LATEST

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

 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 12, 2025 Jun 12, 2025

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 29, 2025 Jun 29, 2025

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 29, 2025 Jun 29, 2025
LATEST

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines