I have a telephone field with validation mask as follows:

^\([0-9]{3}\) [0-9]{3}-[0-9]{4}$

I have an onchange event to change the mask message to a more user
friendly version. Validation works as expected; however, if validation
fails it displays two messages as follows:

Phone Number: value does not match the mask ^\([0-9]{3}\)
Phone Number: The entry 1-233-456-7890 is not valid, must be in the form
of (555) 555-5555. Please try again.

How can I get rid of the default mask message? Ideally I'd like to only
display the bottom message. Any guidance will be appreciated.

Thank you,
onchage event code:

Function for submit button intercept
window.validCatch = function(inv) {
// validMsgSet returns if field is valid
if (validMsgSet() ) {
// value is valid proceed with submit
var result = inv.proceed();
// not valid then don't proceed

Function to validate with mask (default) and set new
message if not valid returns true if field valid, else false
function validMsgSet() {
// check if field is valid, by calling default validation,
//which uses the mask
if (field.validate()) {
// not valid
form.clearMessages(); // get rid of the default
// validation mask message
form.showError("The entry " + field.getValue() + " is " +
"not valid, must be in the form of " + "
"(555) 555-5555 please try again.");
return false; // field not valid
} else {
// valid, clear old messages
return true; // field is valid

Function for on change event, sets up intercept of submit
and does onchange validation

This function is invoked at the end for the onchange

(function () {
var alias = "__" + field.getName( );
if ( !( alias in window ) ) { // first call to onchange do setup
window[ alias ] = field;
// make sure validCatch gets called during a submit
form.interceptAction("SubmitAction", "around",
return; // don't do anything first time called
validMsgSet(); // validate the field on change, every call after 1st
})(); // call the onchange function

ee0001's Profile: https://forums.netiq.com/member.php?userid=3012
View this thread: https://forums.netiq.com/showthread.php?t=47469