Avatar

Level 7

Add this to the exit event of your field:


if (!this.isNull) if(this.rawValue.length != 8){


  xfa.host.messageBox("You must enter 8 characters or leave this blank.");


  xfa.host.setFocus(this);


}



The extra "if" statement ensures that the text field isn't empty before checking the length to keep from throwing an error.