Thanks Ryan for your help and solution!! We are now able to get the values of the checked lines of a Checkbox Group before the form is submitted.
The solution was to call the new function like this in a client side event:
$(SongList) =
CalculateCheckBoxListValues_NEW
(
$(VocalistNo2SongChoices_FieldID),
$(VocalistNo2SongChoices_ValueFieldID)
);
The javascript functions that get the values of the checked lines of a Checkbox Group are:
function CalculateCheckBoxListValues_NEW(CheckBoxList, CheckBoxValField) {
var objChkBoxLst = document.getElementById(CheckBoxList);
var objChkBoxVals = document.getElementById(CheckBoxValField);
var arrChkBoxVals = '';
var CheckedValues = '';
if(objChkBoxVals)
arrChkBoxVals = objChkBoxVals.value.split('|');
if(objChkBoxLst) {
var objChkBoxes = objChkBoxLst.getElementsByTagName('input');
var i;
for(i=0;i
if(objChkBoxes
.checked)
{
CheckedValues += GetCBValue2(i, arrChkBoxVals) + ',';
}
}
}
CheckedValues = CheckedValues.substring(0, CheckedValues.length - 1);
return CheckedValues;
}
function GetCBValue2(intIndex, arrChkValues) {
if(arrChkValues)
{
var i;
var arrTempVals;
//var numRetVal = 0;
var CheckBoxes = '';
for(i=0;i {
arrTempVals = arrChkValues.split(':');
if(arrTempVals)
{
if(arrTempVals[0]==intIndex)
{
CheckBoxes += arrTempVals[1] + ',';
}
}
}
CheckBoxes = CheckBoxes.substring(0, CheckBoxes.length - 1);
return CheckBoxes;
}
}