🚀 SndForms AJAX Integration Example
Quick Setup: Just include the JavaScript file and point your form to the handler. That's it!
1. Include the Script
<script src="metadata/form-ajax.min.js"></script>
2. Create Your Form
<form action="metadata/formhandler.php" method="POST">
<input type="text" name="name" placeholder="Your Name" required>
<input type="email" name="email" placeholder="Your Email" required>
<input type="tel" name="phone" placeholder="Your Phone" required>
<textarea name="message" placeholder="Your Message"></textarea>
<button type="submit">Submit</button>
</form>
3. Working Example
Try this form below - it will show the modal without page reload:
Features
- ✅ No Page Reload - Form submits via AJAX
- ✅ Modern Modal - Beautiful confirmation dialog
- ✅ Auto-Detection - Automatically finds forms pointing to formhandler.php
- ✅ Telegram Integration - Messages sent with emoji formatting
- ✅ Mobile Friendly - Responsive design
- ✅ No Conflicts - Unique CSS classes (sndforms-ajax-*)
Field Types
The handler automatically formats different field types:
- Email/Phone: Copyable with backticks
- URLs: Clickable links
- Names: 👤 emoji
- Money: 💰 emoji
- Messages: 💬 emoji
- Unknown fields: 🔹 emoji
Browser Support
Works in all modern browsers including Chrome, Firefox, Safari, and Edge.
Note: The modal text is in English by default but can be customized by editing the JavaScript file.