|
.container |
|
.row |
|
.col-xs-12 |
|
h3.example-title Bootstrap Form Spam Filter |
|
h4.example-subtitle No CAPTCHA or Human Testers |
|
p.instructions Most spam emails will fill out all fields in a form based on the DOM elements on a page without reading the CSS. In this form there is a field called 'formChecker' wrapped in '.form-checker' with 'Display: none' added in the CSS. If this field is filled out a 'return false' is triggered in the JS, causing the email to not be sent. |
|
br |
|
strong Chrome, Safari, Firefox, IE9+ |
|
#form-container.clearfix |
|
form#ctsForm(role="form", name="ctsForm", onsubmit="return validateForm()").clearfix |
|
.form-group.clearfix |
|
label.label Name |
|
input.form-control(placeholder="Name", name="formName", required) |
|
.form-group.clearfix |
|
label.label Phone |
|
input.form-control(placeholder="Phone Number", name="formPhone") |
|
.form-group.clearfix |
|
label.label Email |
|
input#form-email.form-control(placeholder="Email Address", name="formEmail", type="email", required) |
|
.form-group.clearfix.form-checker |
|
label.label Info |
|
input.form-control(placeholder="Info", name="formChecker") |
|
.form-group.clearfix |
|
label.label Subject |
|
input.form-control(placeholder="Subject", name="formSubject", required) |
|
.form-group.clearfix |
|
label.label Message |
|
textarea.form-control(placeholder="Let us know how we can help you", name="formMessage", required) |
|
.col-xs-3.submit-wrap |
|
button.btn.btn-default.btn-submit(type="submit", value="submit") Submit |
|
img.loading(src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/85807/loading.gif") |
|
.col-xs-9.alert-wrap |
|
.container |
|
.row |
|
.col-xs-12 |
|
p.instructions For IE8 support create the following script to display labels: |
|
pre |
|
| <!--[if lt IE 8]> |
|
| <script> |
|
| $('#form-container label').css({'display':'inline-block !important'}); |
|
| </script> |
|
| <![endif]--> |
|
.container |
|
.row |
|
.col-sm-6 |
|
p.instructions.asp |
|
strong ASP |
|
| initiate if formChecker is empty |
|
pre.dark.asp |
|
| <% |
|
| if (request("formChecker") = "") then |
|
| ' all your form stuff here |
|
| end if |
|
| %> |
|
.col-sm-6 |
|
p.instructions.php |
|
strong PHP |
|
| initiate if formChecker is empty |
|
pre.dark.php |
|
| <?php |
|
| if (request("formChecker") == "") { |
|
| // all your form stuff here; |
|
| } |
|
| ?> |