Changing background fill color based on Radio Button selections


hi,

 

i'm very new scripting in lc, i've hit wall on latest form.i'm trying build form "leikert-like" scale, 1 of stipulations (from boss) background of radio buttons fill based on button selected.

 

for example, question 1 has 4 radio buttons choose from: poor, fair, good, great. if person completing form selects poor, poor background color filled. if selects fair, background color filled, background of poor. selecting fill colors of good, fair, , poor; , selecting great fill colors of four.

 

anyone have ideas of how/if can done? in initial tests, i've gotten button change colors, not background fill (which can changed manually on border palette).

 

any insight appreciated. thanks!

 

aaron

here code can use in change event of exclusiongroup object (titled radiobuttonlist default). it's parent object of each individual radio button.

 

for (var i=0;i<this.resolvenode("#field").classall.length;i++){  if (i<this.rawvalue)   this.resolvenode("#field["+i+"]").border.fill.presence="visible";  else   this.resolvenode("#field["+i+"]").border.fill.presence="hidden"; }  

 

this assumes value each radio button numbered sequentially 1 through many radio buttons have.

 

now here's thing. i'm assuming each radio button has different colour. code colours in javascript, manually picked colours through designers ui. once radio buttons colours set, select radio button , go view>xml source. see element <fill>, add attribute presence="hidden". each radio button. here's mean:

 

                  </caption>                   <border>                      <edge presence="hidden"/>                      <fill presence="hidden"> <!--add presence="hidden" this-->                         <color value="255,0,0"/>                      </fill>                   </border>                   <items>  

 

kyle



More discussions in LiveCycle Designer


adobe

Comments

Popular posts from this blog

Joomal 3.6.3 update error - PHP temporary folder is not set - Joomla! Forum - community, help and support

Upgrade 3.4.8 to 3.5.1 failed "download package failed" - Joomla! Forum - community, help and support

Fatal error during instalation - Joomla! Forum - community, help and support