///////////////////////////////////////////////////////////////////////////
// This javascript validates the quiz_query.html form to see if the student
// has filled in all fields.
//
//                         thomas loewen gibson  May 22, 2003
///////////////////////////////////////////////////////////////////////////
function nameOK()
{
  if ((document.forms[0].name_first.value.length == 0) ||
      (document.forms[0].name_first.value.length > 30))
  {
    alert("I need a valid first name, please");
    return false;
  }
  if ((document.forms[0].name_last.value.length == 0) ||
      (document.forms[0].name_last.value.length > 30))
  {
    alert("I need a valid last name, please");
    return false;
  }
return true;
}
function idOK()
{
  if ((document.forms[0].id_number.value.length < 9) || 
     (document.forms[0].id_number.value.length > 11))
  {
    alert("I need a valid student id#, please");
    return false;
  }
return true;
}
function checkForm(theForm)
{
  if (nameOK() == false)
  {
    return;
  }
  if (idOK() == false)
  {
    return;
  }
  document.forms[0].submit(theForm);
}
