I found a useful script here which made it posible for me to make the
function I wanted.var myRegex = /\d{6}[a-zA-Z]{4}/;if (this.rawValue !=
null || this.rawValue != '') if (this.rawValue.match(myRegex)){ var
nChoice = xfa.host.messageBox("Did you mean 999999-AAAA?", "Messagebox
title",2,2); if (nChoice === 4) { function isEmpty(str) { if(str == null
|| str.length == 0) { return true; } return false; } try { var vEID =
this.rawValue; if (!isEmpty(vEID)){ this.rawValue =
vEID.substr(0,6)+"-"+vEI...