<head><title>Message</title>
<script type="text/javascript">
function isValidEmail(str) {
return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
}
// make sure name text box is filled in
function checkform() {
var cname = document.getElementById('name').value;
var cemail = document.getElementById('email').value;
var ccomment = document.getElementById('comment').value…
// alert(name + " " + email);
if ( cname == "" ) {
alert ("You must enter a full name...");
return false;
}
if ( cemail == "" ) {
alert ("You must enter your email...");
return false;
}
if ( !isValidEmail(cemail) ) {
alert ("You must enter a VALID email address...");
return false;
}
if ( ccomment == "" ) {
alert ("You must enter comment...");
return false;
}
}
</script>
Bookmarks