function validateForm() { suburbListBox = document.getElementById('servicesuburbdropdown'); var count = 0; var selectedArray = new Array(); for (i=0; i<suburbListBox.options.length; i++) { if (suburbListBox.options[i].selected) { selectedArray[count] = suburbListBox.options[i].value; count++; } } if(count == 0) { showDiv(document.getElementById('mBox')); document.getElementById('mBoxContents').innerHTML = '<p><img src="images/cross.gif" align="right" hspace="5" vspace="5" border="0" />There must be at least one service suburb selected from the list of available suburbs.</p>'; return false; } return true; }