There are two Client Actions you can use in your application:
CNPJValidation: Used to validate a CNPJ number by calculating its verification digits. Note that this function already removes the mask, so there is no need to strip mask characters before calling the Client Action.
FormatCNPJ: Used to apply the mask to text inputs in your form. In your application, you should call this Client Action within a Screen Action associated with the "onkeyup" or "onkeydown" events.