Simple Forms
More than just a contact form script!
The most flexible, responsive and secure forms you could find!
Incredible easy to use!
To start using Simple Forms you have to connect required CSS and Javascript to your web page then generate the confing file online to get you started quick and easy! Yo’ll get a fully working contact form with infinite possibilities in no time. For more info check the installation guide.
Get engaging feedback from your clients
Encourage your customers to leave feedback at any moment using prompt and responsive contact forms. Your customers will love engaging with Simple Forms! You are free to choose your email template to get pretty form submissions.
Installation Guide
A quick guide on how to start using Simple Forms.
Include CSS
Add required css file simple-forms.css to your page before closing tag </head>.
<!-- Simple Forms Styles -->
<link rel="stylesheet" href="simple-forms/css/simple-forms.css">
IMPORTANT: Please do not edit/change simple-forms.css file, use a custom css file instead.
Include JS
Add required simple-forms-translations.js and simple-forms.min.js files to your page before closing </body> tag, see example bellow.
<!-- Simple Forms Scripts -->
<script src="simple-forms/js/simple-forms-translations.js"></script>
<script src="simple-forms/js/simple-forms.min.js"></script>
Create a Form
Let's create a full featured form.
Copy & paste form html markup into your page to get started.
If you get any errors please check connected assets path or open browser console (F12 Key)
for errors description.
Form HTML Markup:
<!-- Required Form Wrapper -->
<div class="sf-wrapper">
<!-- Form -->
<form id="contact-form" class="simple-form" action="simple-forms/sendmail.php" method="post">
<!-- Form Header -->
<div class="form-heading">
<h4>Contact US</h4>
<p>
We are here to help.
</p>
</div>
<!-- Form Header -->
<div class="grid">
<div class="grid-col-md-6">
<label>
<input type="text" name="name" value="" class="validate-name" min="2" placeholder="Name*" required>
</label>
</div>
<div class="grid-col-md-6">
<label>
<input type="text" name="phone" class="validate-phone" placeholder="Phone*" required>
</label>
</div>
</div>
<label>
<input type="text" name="email" class="validate-email" value="" placeholder="E-mail address*">
</label>
<label>
<input type="text" name="url" class="validate-email" value="" placeholder="Social Profile">
</label>
<label>
<input type="date" name="date" class="validate-email" value="" placeholder="Pick a date">
</label>
<label>
<select name="subject" title="demo" required>
<option value="">Choose subject</option>
<option value="Support">Support</option>
<option value="Offer">Special offer</option>
<option value="Offer">Other</option>
</select>
</label>
<label>
<textarea name="message" placeholder="Write your message here ..." required></textarea>
</label>
<!-- Drag & Drop Files Uploading -->
<div class="simple-files">
<label class="simple-file-label">
<input type="file" name="files[]" multiple>
<span class="simple-files-trigger"><strong>Select</strong> or drop files here.</span>
</label>
</div>
<div class="form-submit text-center">
<button type="submit">Send now</button>
</div>
<!-- Consent Checkbox -->
<div class="consent">
<label class="custom-checkbox-label">
<input type="checkbox" class="simple-consent-checkbox" name="consent" value="agree" required="" checked>
<span class="custom-checkbox-button"></span>
By clicking the “Send now” button you agree to our <a href="#">Terms and Conditions</a>.
</label>
</div>
<!-- Error & Info messages will show here -->
<div class="server-response"></div>
</form>
</div>
Basic Form Configuration
To get started with Simple Forms a minimum configuration is required.
See bellow a basic form configuration example.
Basic configuration example
Paste the code bellow into your web page to configure your form.
Please follow the comments for available options.
<script>
var simple_forms = new SimpleForms("#contact-form", {
lang: "en", // language for error/info strings
theme: "white", // form color theme, options: white | dark | purple | red | green | blue | faded-light | faded-dark
style: "underline", // form fields style, options: none | underline | classic | classic-rounded | modern | modern-rounded
files: {
enabled: true,
extensions: "gif jpg jpeg png pdf doc docx",
min: 0,
max: 10,
maxFileSize: 24, // Max allowed file size in MB, recommended size: 24
filesUploadHandler: "simple-forms/files-upload-handler.php", // path to files upload handler, default: simple-forms/files-upload-handler.php
},
});
</script>
NOTE: Replace #contact-form in first line with your form ID.
To bind multiple forms use class selector instead of ID.
Advanced Configuration
For more flexibility and customization please see all available options.
A more complex initialization of your form could look like this:
<script>
var simple_forms = new SimpleForms("#contact-form", {
action: "simple-forms/sendmail.php", // set form action attribute, default value: simple-forms/sendmail.php
lang: "en", // language for error/info strings
theme: "white", // form color theme, options: white | dark | purple | red | green | blue | faded-light | faded-dark
style: "underline", // form fields style, options: none | underline | classic | classic-rounded | modern | modern-rounded
ajaxSubmit: true, // send form using AJAX (no page reload)
validate: true, // enable form fields validation
validateOnKeyup: true, // validate form fields On KeyUp Event
browserValidation: false, // use browser validation
tooltips: true, // show validation errors as tooltips, if false will show errors as strings bellow the field
showErrors: true, // show validation errors
responseOverlay: false, // show errors in overlay (cover the form)
focusErrorFields: true, // focus error fields on form submit
debug: true, // enable debugging mode (will show errors in browser console)
hideFormAfterSubmit: false, // hide the form after submit
customSuccessMessage: "", // overwrite server response with a custom message
formCSS: "", // add css styles to the form, example: box-shadow: none;
files: {
enabled: true, // enable files uploading
extensions: "jpg jpeg svg png", // allowed extensions
min: 0, // min required files count
max: 10, // max allowed files count
maxFileSize: 24, // max file item size in MB
filesUploadHandler: "simple-forms/files-upload-handler.php", // files upload handler, default: simple-forms/files-upload-handler.php
},
redirect: {
enabled: true, // enable redirect after form submit
url: "success.html", // url to redirect to
timeout: 3 // redirect timeout (seconds), leave 0 for instant redirect
},
captcha: {
enabled: true, // enable captcha
type: "math", // set captcha type, options: math | recaptcha-v3
siteKey: "", // recaptcha V3 SITE KEY, generate here: https://www.google.com/recaptcha/admin/create
theme: "" // recaptcha theme color, options: light | dark
},
accessibility: {
escapeReset: true, // press ESC key to reset/clear all form fields and files
tabHighlight: true // press tab to highlight form fields
},
consent: true, // enable submit button after consent checkbox is checked
validator: {
rules: { // add custom validation rules
".validate-name": { // select form field with class .validate-name
required: true, // add required attribute to form field
min: 2, // set field min attribute
max: 30, // set field max attribute
name: true // attach NAME validation
},
".validate-phone": {
required: true,
min: 8,
max: 14,
phone: true // attach PHONE validation
},
".validate-email": {
required: true,
min: 8,
email: true // attach EMAIL validation
},
".validate-url": {
required: true,
min: 5,
url: true // attach URL validation
},
".validate-date": {
required: true,
min: 6,
date: true // attach DATE validation
}
}
},
});
</script>
Simple Forms Parameters Description
Parameters above are described in the table bellow. Everything you need to do with your form is probably described here.
Name | Type | Default | Description |
---|---|---|---|
action | string | simple-forms/sendmail.php |
Set form action attribute <form action="...">
|
lang | string | en | Set language for error/info strings |
theme | string | white |
Set form color theme, options: white | dark | purple | red | green | blue | faded-light | faded-dark
|
style | string | underline |
Set form fields style, options: underline | classic | classic-rounded | modern | modern-rounded | none | custom
|
customSuccessMessage | string | empty string | I provided will overwrite server response with a custom message |
formCSS | string | empty string | Add css styles to the form, example: box-shadow: none; |
ajaxSubmit | boolean | true | Send form using AJAX (no page reload) |
validate | boolean | true | Enable form fields validation |
validateOnKeyup | boolean | true | Validate form fields On KeyUp Event |
browserValidation | boolean | false | Use browser validation |
tooltips | boolean | true | Show validation errors as tooltips, if false will show errors as strings bellow the field |
showErrors | boolean | true | Show validation errors |
responseOverlay | boolean | false | show errors in a overlay with additional status icon |
focusErrorFields | boolean | true | focus error fields on form submit |
debug | boolean | true | Enable debugging mode (will show errors in browser console) |
hideFormAfterSubmit | boolean | false | Hide the form after submit |
consent | boolean | false | Enable submit button after consent checkbox is checked |
files | object | true |
Enable files uploading
|
redirect | object | false |
Enable redirect after form submit
|
captcha | object | false |
Enable captcha
|
accessibility | object | false |
Set accessibility options
|
validator | object | object |
Add custom validation rules
|