// This is the function you would use to require certain fields to be filled in when submitting a form.
// In this case it is just the name and e-mail, but it can be applied to any other field.

function validate(form) {
	var e = form.elements, m = '';
	
	if(!e['first_name'].value) {
		m += '- Please fill in First Name.\n';
	}
	if(!e['last_name'].value) {
		m += '- Please fill in Last Name.\n';
	}
	if(!e['email'].value) {
		m += '- Please fill in E-Mail.\n';
	}
	if(m) {
		alert('The following error(s) occurred:\n\n' + m);
		return false;
	}
	return true;
}

// You would also need to make sure you have the onSubmit property declared within the <form> tag.
// For example: <form onSubmit="return validate(this)" method="post" action="process_contact.php">
