This is Client-Side Validation. Validation is performed on the client machine web browsers.
Forms can be submitted to the web page itself using PHP. The main purpose of submitting forms to self is for data validation. Data validation means checking for the required data to be entered in the form fields.
<form action="<?=($_SERVER['PHP_SELF'])?>" method="POST">
<input type="text" name="somename">
<input type="submit" value="press">