Handle on Click

How could I control button not return to another view() when client doesn’t fill enough value.
Like when you click Next button, but you don’t insert your name in name input, website will stay where you are.
Thanks!