
<script language="JavaScript1.3"><!-- hide from old browsers
function validate (form) {
    if (form._submit.value == "delete") {
       if (confirm("Really DELETE this entry?")) return true;
       return false;
    } else if (form._submit.value == "Cancel") {
       return true;
    }
    var alertstr = '';
    var invalid  = 0;

    // standard text, hidden, password, or textarea box
    var id = form.elements['id'].value;
    if ( (! id.match(/^[a-z]+[a-z0-9]$/)) ) {
        alertstr += '- You must enter a valid value for the "ID" field: small letters a-z for the first letter. a-z0-9 for the following.\n';
        invalid++;
    }
    // standard text, hidden, password, or textarea box
    var firstname = form.elements['firstname'].value;
    if ( (! firstname.match(/^[a-zA-Z ]+$/)) ) {
        alertstr += '- You must enter a valid firstname. Possible letters are: a-z A-Z.\n';
        invalid++;
    }
    // standard text, hidden, password, or textarea box
    var lastname = form.elements['lastname'].value;
    if ( (! lastname.match(/^[a-zA-Z ]+$/)) ) {
        alertstr += '- You must enter a valid lastname. Possible letters are: a-z A-Z.\n';
        invalid++;
    }
    // standard text, hidden, password, or textarea box
    var new_password = form.elements['new_password'].value;
    if ( (! new_password.match(/^[a-zA-Z]+$/)) ) {
        alertstr += '- You must enter a valid value for the "New Password" field\n';
        invalid++;
    }
    // standard text, hidden, password, or textarea box
    var new_password_repeat = form.elements['new_password_repeat'].value;
    if ( (! new_password_repeat.match(/^[a-zA-Z]+$/)) ) {
        alertstr += '- You must enter a valid value for the "New Password Repeat" field\n';
        invalid++;
    }
    if (invalid > 0 || alertstr != '') {
        if (! invalid) invalid = 'The following';   // catch for programmer error
        alert(''+invalid+' error(s) were encountered with your submission:'+'\n\n'+alertstr+'\n'+'Please correct these fields and try again.');
        // reset counters
        alertstr = '';
        invalid  = 0;
        return false;
    }
    return true;  // all checked ok
}
//-->
</script><noscript><font color="red"><b>Please enable JavaScript or use a newer browser</b></font></noscript>
