I am trying to validate a form field so that the post won't proceed if the field is set with a value. So my field is:
 <input type="text" name="validator" id="validator" value="" title="validator" class="myClass" />
and then I'm using the following snippet to check if it has been filled:
 jQuery("form").submit(function(){
     <?php if(isset($_POST['validator']) || !empty($_POST['validator'])){
                        die("Unable to write to database");
                        }
                ?>
      });
but when I hit the submit button the form continues and registers the new user. What't wrong with my code please ?
 
    