Best way to create custom on screen error

I want to create a custom on-screen error for a field on ticket create, and cancel the ticket create until it is fixed. How would I best do this, and which files would I need to modify?