Quantcast
Channel: Adobe Community : Discussion List - LiveCycle Forms
Viewing all articles
Browse latest Browse all 1160

Single or multiple check box values displayed in a textbox

$
0
0


Hi Experts!

 

I'm using the following script to display the values of check boxes in a text field.  I would like the word "and" to separate the values if two check boxes are selected. If more than two boxes are selected I want the values to be separated by a comma and then the last value be separated by "and".  Example of two check boxes selected:  A and B.  Example of two or more: A, B, C, and D.  Can this be done?

 

 

form1.page1.page1SF.programs::calculate - (JavaScript, client)

 

//displays the values of check boxes named programCB

var aChkBx = [];

var vChecks = programCB.all;

 

for (var a=0; a<vChecks.length;a++){

if(!vChecks.item(a).isNull) {

aChkBx.push(vChecks.item(a).rawValue);

}

}

this.rawValue = aChkBx.join(", ");


Viewing all articles
Browse latest Browse all 1160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>