From my perspective, the correct and best way to do this in Mendix 8 is to use a Pluggable Widget that implements a standard masking library. The new widget properties make it easy to implement normal text box properties like using a label, conditional visibility, and conditional editability, plus use prebuilt components like react-input-mask. I had a very simple version of this concept working in about an hour, and I hope to flesh it out over the coming weeks. Happy to share my code – just reach out.
My best guess as to why your code no longer works as expected is due to input widgets now being based on react. This discussion talks about it a little bit. Essentially I think you shouldn’t try to set the value of an `input` element directly.
probably not that much refactoring for your use case (adjust the code a little and paste it into your js code, nano flow and use is it as on enter/change flow on the fields)
Why not using a regex either on domain model level or in a validation check in microflow/nanoflow?
That would be better maintainable and fits the platform the best imho.