Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Removing fill color of checkbox field upon deselection.

Avatar

Level 4

When a user selects a checkbox, the field turns yellow. Unfortunately, when the user deselects the checkbox, the color remains.  I know I need an if/else statement to remove the color upon deselection, but cannot get quite the right script. The checkbox named LEPID is my guinea pig and it still has the nonfuctioning script I have been working with. Can anyone tell me how to remove the fill color when the checkbox is deselected?  Thanks!

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi again,

You had some mistakes in script:

1) in condition you shoud use == instead =

2) if (condition) but not if{condition}

this is working script:

if (this.rawValue == "1") {

this.fillColor

="244,254,114";

}

else {

this.fillColor

="255,25,128";

}

Also see attach.

BR,

Paul Butenko

View solution in original post

7 Replies

Avatar

Correct answer by
Level 6

Hi again,

You had some mistakes in script:

1) in condition you shoud use == instead =

2) if (condition) but not if{condition}

this is working script:

if (this.rawValue == "1") {

this.fillColor

="244,254,114";

}

else {

this.fillColor

="255,25,128";

}

Also see attach.

BR,

Paul Butenko

Avatar

Level 4

Wonderful--THANKS! I've learned quite a bit of useful stuff from you in the last couple of days .  You are super helpful.

Do you know of a good and easy to understand source that explains the basics of java syntax, such as when to use {} as opposed to ()--basics that I seem to be missing?

Avatar

Level 6

Hi,

This is links about some basics related javascript syntax and control flow:

http://home.cogeco.ca/~ve3ll/jstutor2.htm

http://home.cogeco.ca/~ve3ll/jstutor3.htm

Also, I've attached some docs related Adobe scripting and FormCalc language.

BR,

Paul Butenko

Avatar

Level 4

Thanks Paul.  I checked out the site--very fruitful. It cleared up a couple basic things for me such as when to use () or {}.  The pdf's will be a helpful resource also, I am sure.

Take care,

JennyAnnRowe

Avatar

Level 1

How it get roll over when you hit 'Clear out'?

Avatar

Level 1

any one know how the disabled field or check box get back when hit of 'clear out'?

Avatar

Level 4

I haven't had to do that, sorry.

~Jennifer