i am trying to get the message inside the (ack div) without refreshing the page I have following code
index.php index page is the page which contain form and css file
contact form body{ background:#eee;} .errors{color:red; margin:4px; font-style:italic; } label{ display:block; }#container{
margin:auto;
width:800px;
padding:15px;
background:white;
border-radius:5px;
#container{
margin:auto;
width:800px;
padding:15px;
background:white;
border-radius:5px;
}
input[type=text], input[type=email]{
width:200px;
padding:5px;
margin-right:4px;
}
<?php if($_POST) { $errors = array(); $name = $_POST['name']; $email = $_POST['email']; $comment = $_POST['comment']; $emailReg = '/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/ '; if(!($name) || !($email) || !($comment)){ if(!$name){ $errors[]="Missing Name"; } if(!$email){ $errors[]="Missing Email"; } if(!$comment){ $errors[]="Missing Comment"; } }elseif(!preg_match($emailReg,$email)){ $errors[] = "Not a valid email address"; } if(count($errors) == 0){ $errors = "No errors found"; } else{ $output = ""; foreach($errors as $error){ $output .= "
$error
"; } } } ?>*********************************************************************************8