soulpumpkin
Programmer
I'm not very versed in JavaScript, and I'm having trouble getting the below code to work. It should test to make sure only a single selection was made, but it isn't working:
Could someone point me in the right direction?
Soul Pumpkin
Code:
function validateForm(varFormAction){
var formValidated = true;
//check to make sure one is selected
if(varFormAction == "OpenSim"){
if(document.forms[0].SimList.selectedIndex == -1){
alert("Please choose a simulation.");
formValidated = false;
}
}
//check to see if only one is selected
if(document.forms[0].SimList.options.length > 1){
alert("Please choose a single simulation.");
formValidated = false;
}
}
Could someone point me in the right direction?
Soul Pumpkin