This is a straight forward and semantic contact form with usability in mind. It provides a standard contact form with name / email / subject / message fields. It will check and validate all field input and return errors while keeping the user's input untouched.
It also includes an non-obtrusive way of combatting spambots.
<?php TB_Contactform('youremail@yourdomain.com'); ?>
.tbContactform .antispam {
display: none;
visibility: hidden;
}
.tbContactform label {
width: 95px;
display: inline-block;
vertical-align: top;
clear: both;
}
.tbContactform input.text,
.tbContactform textarea {
width: 225px;
padding: 2px;
}
.tbContactform textarea {
height: 115px;
}
.tbContactform input.submit
{
display: block;
margin-left: 250px;
width: auto;
}
.tbContactform .tbErrors p
{
color: #FF0000;
}
index.php file to finetune the form to your likings.The TB_Contactform function takes four variables:
<?php TB_Contactform('youremail@yourdomain.com', 'ccemail@yourdomain.com', 'Success message heading', 'Success message body'); ?>
Only the first variable is mandatory. Leave any of the other variables blank to keep the defaults. For example, to override the default success message without sending a CC use the following code:
<?php TB_Contactform('youremail@yourdomain.com', '', 'Success message heading', 'Success message body'); ?>
| 1.0.2 | 21 December 2009 | Fixed a syntax error in the makeSafe function. Thanks Stefan Probst! |
| 1.0.1 | 3 September 2009 | Fixed a bug in the makeSafe function with the handling some special characters. Thanks to Konstantin Baev for notifying me of the bug. |
| 1.0 | 29 April 2009 | Initial stable release. |
TB_Contactform is licensed under a CC Attribution-Share Alike 3.0 Netherlands License