Don't dismiss Alert if condition

Hi! I have an alert with an imput.

I don’t want the user to leave the alert if check the input value and its null for example.

But anytime I press the button, its dismissed, no mather what. Is there any way to prevent an alert to be dismissed??

Thank you!