Comparing 2 inputs with data set.

When I enter the text box, the wrong password duplicates the message and if I delete it from the box, the box will be deleted. How can I make the box invisible and visible to me when the error occurs?