﻿function validateForm(form) { //This is the name of the functionif (form.your_name.value == "") { //This checks to make sure the field is not empty   alert("Please fill in your name."); //Informs user of empty field   form.your_name.focus( ); //This focuses the cursor on the empty field   return false; //This prevents the form from being submitted   }if (form.your_email.value == "") { //This checks to make sure the field is not empty   alert("Please fill in your email."); //Informs user of empty field   form.your_email.focus( ); //This focuses the cursor on the empty field   return false; //This prevents the form from being submitted   }if (form.friend_name.value == "") { //This checks to make sure the field is not empty   alert("Please fill in your friend's name."); //Informs user of empty field   form.friend_name.focus( ); //This focuses the cursor on the empty field   return false; //This prevents the form from being submitted   }if (form.friend_email.value == "") { //This checks to make sure the field is not empty   alert("Please fill in your friend's email."); //Informs user of empty field   form.friend_email.focus( ); //This focuses the cursor on the empty field   return false; //This prevents the form from being submitted   }// you may copy the above 5 lines for each form field you wish to validate// Replace the text "FIELD1" with the name you wish to call the field}