E
effendi
I have a page with checkboxes generated by a script. Users are suppose
to select the checkboxes and click on a button to process their
selection. The codes work fine except when I only have one checkbox on
the page. Then it will not register sReturn. Can anyone help me out,
why this occur when there is only 1 checkbox on the page. Thanks in
advance.
function processOutcome(){
mainDatabase=document.forms[0].AssessDatabase.value
var oCheckboxs=document.forms[0].TeamID
var sReturn="";
for (var i=0;i<oCheckboxs.length;i++){
if (oCheckboxs.checked)
if (sReturn=="")
sReturn=oCheckboxs.value;
else
sReturn=sReturn+","+oCheckboxs.value;
}
if (sReturn=="") {
alert("Select a team for Outcome Assessment"); }
else {
window.location="/"+mainDatabase+"/outcome?openform&TeamID=" +sReturn}
}
to select the checkboxes and click on a button to process their
selection. The codes work fine except when I only have one checkbox on
the page. Then it will not register sReturn. Can anyone help me out,
why this occur when there is only 1 checkbox on the page. Thanks in
advance.
function processOutcome(){
mainDatabase=document.forms[0].AssessDatabase.value
var oCheckboxs=document.forms[0].TeamID
var sReturn="";
for (var i=0;i<oCheckboxs.length;i++){
if (oCheckboxs.checked)
if (sReturn=="")
sReturn=oCheckboxs.value;
else
sReturn=sReturn+","+oCheckboxs.value;
}
if (sReturn=="") {
alert("Select a team for Outcome Assessment"); }
else {
window.location="/"+mainDatabase+"/outcome?openform&TeamID=" +sReturn}
}