That's because before you send the form, the 'test' field in the $_POST array has not been set, so it doesn't exist. When you submit the form, the variable gets a value, and there is no error any more.
What you'll want to do is check weather or not it has been set, as in
PHP Code:
if (isset($_POST['test'])) { // do things with it } else { // form have not been submited yet }
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
|