needing to check to make sure that only one of my seven drop down boxes
is selected - is there a way to assign a count variable (increment)
whenever a drop down is selected and thus use that in the checking
mechanism, or would there be a simpler way?
Thanks
=======================
<script language="JavaScript">
// last name
function checkLastName (strng) {
var error = "";
if (strng == "") {
error = "Please enter your last name.\n\n";
}
return error;
}
// department
function checkDepartment (strng) {
var error = "";
if (strng == "") {
error = "Please enter your department.\n\n";
}
return error;
}
// valid selector from dropdown list
function checkClassSession(choice) {
var error = "";
if (choice == 0) {
error = "Please choose a class session from the drop-down
list.\n\n";
}
return error;
}
<!-- Begin check form script -->
<!--
function checkWholeForm(theForm) {
var why = "";
why += checkLastName(theForm.last_name.value);
why += checkDepartment(theForm.department.value);
why += checkClassSession(value);
if (why != "") {
alert(why);
return false;
}
return true;
}
// -->
</script>
---------
here is the way it's called in the body:
<form name="theForm" method="post" onsubmit="return
checkWholeForm(this)"
action="http://www.domain.com/cgi-bin/ge*****************@doman.com">
----------
Thanks again,
Louis