<!-- HIDE
//  Copyright (c) 2000 WinWriters
//  You are free to use or modify this code only if you reference the
//  WinWriters web site http://www.winwriters.com
//  Coded by Rick Schlamp

//Script to check for missing required form information before server submission

function ChkForm(survey2000) {

var AlertText = "We need you to respond to each question. You did not respond to the following:\n\n";
var ErrFlag = 0;
var ChkFlag, i;
var numButtons;

//Reset generic respondent name to email address
document.forms[0].realname.value = document.forms[0].email.value;

// Check for missing information in text boxes
if (survey2000.email.value == "") {
    AlertText += "           Your email address\n";
    ErrFlag = 1;
    }
   

// Check for "Other" textboxes unfilled with a radio button ranking not default
// . . . if so, set default value

numButtons = 6;

if (survey2000.TEOther.value == "") {
    for (i = 0; i < numButtons; i++) {
    survey2000.TEOther_Exp[i].checked = false;
    survey2000.TEOther_Imp[i].checked = false;
    }
    survey2000.TEOther_Exp[numButtons-1].checked = true;
    survey2000.TEOther_Imp[numButtons-1].checked = true
}

if (survey2000.FEOther.value == "") {
    for (i = 0; i < numButtons; i++) {
    survey2000.FEOther_Exp[i].checked = false;
    survey2000.FEOther_Imp[i].checked = false;
    }
    survey2000.FEOther_Exp[numButtons-1].checked = true;
    survey2000.FEOther_Imp[numButtons-1].checked = true
}

if (survey2000.ATOther.value == "") {
    for (i = 0; i < numButtons; i++) {
    survey2000.ATOther_Sat[i].checked = false;
    }
    survey2000.ATOther_Sat[numButtons-1].checked = true
}

// If no missing required info, return a true and pass form to server

if (ErrFlag == 0) return true;

// Otherwise, return a false with an alert box
    
AlertText += "\nPlease supply the missing information and click Submit Survey.";
    
alert(AlertText);
return false;

}

//STOP HIDING -->
