🎯 Dynamic and configurable form management system for talks and presentations. 🎤 A modern and flexible template that allows you to create feedback forms quickly and efficiently, with automatic validation and responsive design.
✨ This project is developed by susarroDEV with vanilla JavaScript to offer a lightweight, fast and easy-to-integrate solution for any website. ✨
📜 Table of contents
Some of the main features of the system include:
- 📱 Fully responsive design: Optimized for all devices and screen sizes.
- 🔧 Flexible configuration: JSON-based system to define forms dynamically.
- ✅ Automatic validation: Real-time validation with customizable error messages.
- 🎨 Modern interface: Clean design with CSS animations and interactive effects.
- 📤 Asynchronous submission: Form handling with fetch API and JSON responses.
- 🎯 Varied field types: Input, textarea, select, radio, checkbox and more.
-
Clone the repository
git clone https://github.com/susarrodev/template-form-speech.git
-
Navigate to the project directory
cd template-form-speech -
Serve the files from a local web server
# Example with Live Server in VS Code # Or with Python python -m http.server 8000 # Or with Node.js npx serve .
-
Include the FormManager in your HTML:
<div id="main-form-container"></div> <script type="module"> import FormManager from './src/form-manager/index.js' const mainForm = new FormManager('main-form-container', 'contact', 'en') </script>
-
Configure your form in
src/data/forms.js:export const formsConfig = { myForm: { id: "my-form", name: "My Custom Form", // ... form configuration } }
Each form is defined with the following structure:
{
id: "form-id", // Unique form ID
name: "Form Name", // Descriptive name
action: "/api/endpoint", // Submission URL
method: "POST", // HTTP method
className: "custom-class", // Additional CSS class
submitButtonText: "Submit", // Button text
successMessage: "Success!", // Success message
errorMessage: "Error...", // Error message
sections: [...] // Form sections
}- text: Simple text field
- email: Email field with validation
- tel: Phone field
- textarea: Text area with auto-resize
- select: Dropdown list
- radio: Radio buttons
- checkbox: Checkboxes
- number: Numeric fields
validation: {
minLength: 10, // Minimum length
maxLength: 500, // Maximum length
pattern: "^[a-zA-Z]+$", // Regular expression
errorMessage: "Custom message" // Custom error message
}Styles are organized in modular files:
styles/global.css- Global stylesstyles/header.css- Header stylesstyles/form-manager.css- Form stylesstyles/footer.css- Footer styles
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated! 💖
Here's a quick guide:
- Fork the Project (fork)
- Clone your fork (
git clone <fork URL>) - Add the original repository as remote (
git remote add upstream <original repository URL>) - Create your Feature Branch (
git switch -c feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add: some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a pull request
If you have questions or suggestions, feel free to contact susarroDEV. 💌