// Checkbox buttons for Edit packages
function displaybox(box) {
// get reference to form object, and to array of same-named checkboxes
var temparr = new Array(), f = box.form, boxgroup = f[box.name];
// loop through it
for (var i=0; i<boxgroup.length; i++) {
// add the value of any checked box to next available slot in temparr
if (boxgroup[i].checked) temparr[temparr.length] = boxgroup[i].value;
// run the .join() method on the array (separator = ',') and output it to field
f.legal_text.value = temparr;
}
}