Adding the number of checkboxes checked


hi!

i have absolutely no programming experience @ all... hoping might me.  if have check boxes sunday-saturday entire month, (name them s1, m1, t1, w1, r1, f1, sa1, etc...), custom calculation script total how many of boxes checked on form?

 

the function of form calculate number of visits therapist made in given week of patients seen, (sunday-saturday maybe 20 patients), actual script include 140 boxes looking how many checked. 

 

certainly, possible... right?

 

thanks!

amanda

sure. let's have text field should display total number of boxes displayed.

use code field's custom calculation script:

 

var checkboxes = ["s1", "m1", "t1", "w1", "r1", "f1", "sa1"]; // enter here names of checkbox fields

var total = 0;

for (var in checkboxes) {

     var f = this.getfield(checkboxes[i]);

     if (f==null) app.alert("invalid field name: " + checkboxes[i]);

     else if (f.value!="off") total++;

}

event.value = total;



More discussions in JavaScript


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account