Button to change color when it's clicked and when clicked again going back to the original color.
Hi I've been really struggling with making a button to change color.
Basically, I have a yellow button called 'button1', and when I click this button, the button will be blue,
and when I click again, it goes back to yellow again.
I found this code from other post, but it only works, just one-time color change, not going back to the original color after clicking again. Thank you.
this.resetForm();
for (var i = 0; i < this.numFields; i++) {
var oFld = this.getField(this.getNthFieldName(i));
oFld.fillColor = color.transparent;
}
event.target.fillColor = ["RGB", 255/255, 255/255, 204/255]; // light yellow
