Stephen,
Thanks for your help - for some reason it isn't working. The only
change I made was in the "JustSelect.one(document.forms.myForm);" line,
as I changed myForm to theForm, as that's the name of the form.
I have another javascript validation code that I'm running on the
"final" form, for the other form elements, via the onsubmit="return..
method. Would it be possible to do this type of dropdown validation
along with the following type of javascript
:
=======================
<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;
}
/**/
<!-- End "validate.js" code -->
<!-- Begin check form script, which refers to "validate.js" code,
listed above -->
<!--
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
Stephen Chalmers wrote:
ll wrote: Stephen,
Thanks for your help. Where would the " JustSelect.one(
document.forms.myForm );" go? Would that be after the form, in the
body? Are any changes necessary, beyond changing the name of the form
to suit mine?
Anywhere below the form, so it's not called until the form exists.
No changes are needed to the HTML.