There are a number of possibilities, including saving it in a database or emailing the data to yourself. here's the form: i found javascript code for how to check individual form elements, but i can't figure out how i could combine multiple without submitting. Form Validation is a necessary process before the data entered in the form is submitted to the database. Is it OK to ask the professor I am applying to for a recommendation letter? This cookie is set by GDPR Cookie Consent plugin. You can't use solely PHP to perform any form validation without submitting the form. It is also used to pass variables. Analytical cookies are used to understand how visitors interact with the website. How To Distinguish Between Philosophy And Non-Philosophy? $nameErr = $emailErr = $genderErr = $websiteErr = ""; $name = $email = $gender = $comment = $website = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") {, if (empty($_POST["name"])) {. First, define some constants to store the error messages. the form has been submitted - and it Following is the form code: