Avatar

Level 5

I figured it out!  It just needs to be like this:

//replace @ with "@domain.com"

if (xfa.event.change == "@") {

  xfa.event.change = "@domain.com";

}

So it will generate the suffix string only when you press "@", and it allows corrections without duplication, etc.