Canadian postal codes follow the A9A 9A9 format.
In my display validation pattern, I have
In my edit validation pattern, I have
In my validation pattern, I have
this.rawValue = this.rawValue.toUpperCase();
Given these paramaters, I am stumped as to why I keep getting the following validation error: "The value you entered for Postal Code in valid."
Your uppercase code should be on the exit event of the field. The validation pattern works by testing against the display pattern.
Or you could put xfa.event.change = xfa.event.change.toUpperCase(); on the change event of the field.
event.value = event.value.toUpperCase();
if(event.value != "")
// validate Canadian postal code;
event.rc = /^(?!.*[DFIOQU])[A-VXY][0-9][A-Z][0-9][A-Z][0-9]$/.test(event.value);
if(event.rc == false)
app.alert("Please enter a correct Canadian Postal code", 1, 0);