Created
April 25, 2015 22:37
-
-
Save mofizul21/2edac846ca6f33e103f5 to your computer and use it in GitHub Desktop.
PHP Email Contact Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="form-horizontal" method="POST" name="contactform" action="contact-form-handler.php" id="form"> | |
<div class="form-group"> | |
<label for="contact_name" class="col-lg-2 control-label">Name</label> | |
<div class="col-lg-10"> | |
<input type="text" class="form-control" id="contact_name" name="name"> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="contact_email" class="col-lg-2 control-label">Email</label> | |
<div class="col-lg-10"> | |
<input type="email" class="form-control" id="contact_email" name="email"> | |
</div> | |
</div> | |
<div class="form-group"> | |
<label for="contact_textarea" class="col-lg-2 control-label">Message</label> | |
<div class="col-lg-10"> | |
<textarea class="form-control" rows="3" id="contact_textarea" name="message"></textarea> | |
</div> | |
</div> | |
<div class="form-group"> | |
<div class="col-lg-offset-2 col-lg-10"> | |
<input type="hidden" name="submitted" id="submitted" value="true" /> | |
<button type="submit" class="btn btn-default" name="submitted"><i class="icon-paperplane"></i>Send</button> | |
</div> | |
</div> | |
</form> | |
<script language="JavaScript"> | |
// Code for validating the form | |
// Visit http://www.javascript-coder.com/html-form/javascript-form-validation.phtml | |
// for details | |
var frmvalidator = new Validator("contactform"); | |
frmvalidator.addValidation("name","req","Please provide your name"); | |
frmvalidator.addValidation("email","req","Please provide your email"); | |
frmvalidator.addValidation("email","email","Please enter a valid email address"); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment