[color=#4080BF]function checkListBoxSize(){ var minNum=2; var maxNum=8; var len = document.frmChangeCtrl.multival.length; var chosen = ""; var chosiefr; var j = 0; for (j = 0; j < len; j++) {
if (document.frmChangeCtrl.multival[j].selected) { chosen = chosen + document.frmChangeCtrl.multival[j].value + "\n" chosiefr = chosen.match("Sec"); } if (!(chosiefr == null)) { document.getElementById('financials').style.display=''; alert('A secondary portfolio on multi branch is selected.'); if (!(chosiefr == null) && (document.frmChangeCtrl.finopt.value == " ")) { alert('A secondary portfolio on multi branch isn\ selected so a financial branch must be chosen.'); } return false; } else {document.getElementById('financials').style.display='none';} }
return true;
}//end function[/color]
What I need the function to do is validate whether the field finopt, also a select menu, has had a value chosen IF the value of the previous select menu includes "Sec", as noted in the match method used.