function ForceDate(objField,strField){
    var str = new String(objField.attr("value"));

    if (isWhitespace(str)) {
        return true;
        // if the field is empty, just return true...
    }

    var i = 0, count = str.length, j = 0;
    while ((str.charAt(i) != "/" && str.charAt(i) != "-") && i < count)
        i++;

    if (i == count || i > 2) {
        PromptErrorMsg(objField,strField);
        return false;
    }

    var addOne = false;
    if (i == 2) addOne = true;

    if (!isDateNumber(str.substring(0,i),1)) {
        PromptErrorMsg(objField,strField);
        return false;
    }

    j = i+1;
    i = 0;

    while ((str.charAt(i+j) != "/" && str.charAt(j+i) != "-") && i+j < count)
        i++;

    if (i+j == count || i > 2) {
        PromptErrorMsg(objField,strField);
        return false;
    }

    if (!isDateNumber(str.substring(j,i+j),2)) {
        PromptErrorMsg(objField,strField);
        return false;
    }

    j = i+3;
    i = 0;

    if (addOne) j++;

    while (i+j < count)
        i++;


    if (i != 2 && i != 4) {
        PromptErrorMsg(objField,strField);
        return false;
    }

    if (!isDateNumber(str.substring(j,i+j),3)) {
        PromptErrorMsg(objField,strField);
        return false;
    }

    return true;
}
/* PURPOSE: Checks to see if the string is a valid date.  A valid
	date is defined as any of the following:

		MM/DD/YY, MM/DD/YYYY, M/D/YY, M/D/YYYY,
		MM-DD-YY, MM-DD-YYYY, M-D-YY, M-D-YYYY
*/
Checks to see if the string is a valid date.  A valid
date is defined as any of the following.


Checks to see if the string is a valid date . A valid date is defined as any of the following .
function ForceDate(objField,strField){
    var str = new String(objField.attr("value"));
    if (isWhitespace(str)) {
        return true;
    }
    var i = 0, count = str.length, j = 0;
    while ((str.charAt(i) != "/" && str.charAt(i) != "-") && i < count)
        i++;
    if (i == count || i > 2) {
        PromptErrorMsg(objField,strField);
        return false;
    }
    var addOne = false;
    if (i == 2) addOne = true;
    if (!isDateNumber(str.substring(0,i),1)) {
        PromptErrorMsg(objField,strField);
        return false;
    }
    j = i+1;
    i = 0;
    while ((str.charAt(i+j) != "/" && str.charAt(j+i) != "-") && i+j < count)
        i++;
    if (i+j == count || i > 2) {
        PromptErrorMsg(objField,strField);
        return false;
    }
    if (!isDateNumber(str.substring(j,i+j),2)) {
        PromptErrorMsg(objField,strField);
        return false;
    }
    j = i+3;
    i = 0;
    if (addOne) j++;
    while (i+j < count)
        i++;
    if (i != 2 && i != 4) {
        PromptErrorMsg(objField,strField);
        return false;
    }
    if (!isDateNumber(str.substring(j,i+j),3)) {
        PromptErrorMsg(objField,strField);
        return false;
    }
    return true;
}
function ForceDate ( objField , strField ) { var str = new String ( objField . attr ( "value" ) ) ; if ( isWhitespace ( str ) ) { return true ; } var i = 0 , count = str . length , j = 0 ; while ( ( str . charAt ( i ) != "/" && str . charAt ( i ) != "-" ) && i < count ) i ++ ; if ( i == count || i > 2 ) { PromptErrorMsg ( objField , strField ) ; return false ; } var addOne = false ; if ( i == 2 ) addOne = true ; if ( ! isDateNumber ( str . substring ( 0 , i ) , 1 ) ) { PromptErrorMsg ( objField , strField ) ; return false ; } j = i + 1 ; i = 0 ; while ( ( str . charAt ( i + j ) != "/" && str . charAt ( j + i ) != "-" ) && i + j < count ) i ++ ; if ( i + j == count || i > 2 ) { PromptErrorMsg ( objField , strField ) ; return false ; } if ( ! isDateNumber ( str . substring ( j , i + j ) , 2 ) ) { PromptErrorMsg ( objField , strField ) ; return false ; } j = i + 3 ; i = 0 ; if ( addOne ) j ++ ; while ( i + j < count ) i ++ ; if ( i != 2 && i != 4 ) { PromptErrorMsg ( objField , strField ) ; return false ; } if ( ! isDateNumber ( str . substring ( j , i + j ) , 3 ) ) { PromptErrorMsg ( objField , strField ) ; return false ; } return true ; }
PURPOSE: Checks to see if the string is a valid date.
PURPOSE : Checks to see if the string is a valid date .
// if the field is empty, just return true...