If you're trying to enter a date I don't see why you would want to use a text field over a date field. However, if you absolutely need a text field you could use regex in the validate event like so:
if (!(this.isNull || this.rawValue.length == 0)) {
//Test for MM/DD/YYYY format
var pattern = new RegExp("^(0[1-9]|1[0-2])\/(0[1-9]|1\d|2\d|3[01])\/\d{4}$","g");
var isMatch = pattern.test(this.rawValue);
if(!isMatch)
xfa.host.messageBox("The date you entered is in an incorrect format", "Error");
}
//Disables validation trigger
true;
To reiterate, I highly discourage you from using this method. It is incomplete since you can still enter dates like 02/30/2000 which would obviously be invalid.