How do I deactivate a form during validation?

Hi, could you show me an example of the implementation?