 
function setFocus(aField) {
document.forms[0][aField].focus();
}

function isEmpty(aTextField) {
if ((document.forms[0][aTextField].value.length==0) ||
 (document.forms[0][aTextField].value==null)) {
return true;
}
else { return false; }
}

function validate() {
// will return true or false
// Step 1: check that required fields are
// filled in, alert and exit without
// submitting if not

// check that the name field is valued

// check that the name field is valued
if (isEmpty("fullname")) {
	alert("Please enter your name.");
	setFocus("fullname");
	return false;
}
// check that the enclavename field is valued
if (isEmpty("enclavename")) {
	alert("Please enter Enclave name.");
	setFocus("enclavename");
	return false;
}
// check that the enclaveuserid field is valued
if (isEmpty("enclaveuserid")) {
	alert("Please enter Enclave login name.");
	setFocus("enclaveuserid");
	return false;
}
// if we get this far everthing is ok, so
// let the form submit
return true;

}
  
