TBit External Apps allows you to embed powerful, dynamic applications directly into your website. Get started in minutes with our simple embed script.
Add the TBit Forms embed script to your HTML page:
<script src="https://exapps.tbit.io/embed/forms.js"></script>Place a container element where you want the form to appear:
<div id="tbit-form" data-form-id="YOUR_FORM_ID"></div>Create a form in your TBit dashboard and copy the Form ID. Replace YOUR_FORM_ID with your actual form ID.
| Attribute | Description | Default | Example |
|---|---|---|---|
data-form-id | Your form ID (required) | - | 507f1f77bcf86cd799439011 |
data-width | Form width | 100% | 600px |
data-height | Form height | auto | 800px |
data-theme | Color theme | tbitLight | tbitDark |
Listen for form submission events:
document.getElementById("tbit-form").addEventListener("tbitFormSubmitted", (e) => { console.log("Form submitted:", e.detail); // e.detail.formId - The form ID // e.detail.submissionId - The submission ID});Use the TBitForms API for programmatic control:
// Initialize forms manuallyTBitForms.init();// Reload a specific formTBitForms.reload("YOUR_FORM_ID");// Change theme for all formsTBitForms.setTheme("tbitDark");<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>My Contact Form</title> <script src="https://exapps.tbit.io/embed/forms.js"></script></head><body> <h1>Contact Us</h1> <div id="tbit-form" data-form-id="507f1f77bcf86cd799439011" data-width="100%" data-height="auto" data-theme="tbitLight"> </div> <script> document.getElementById("tbit-form") .addEventListener("tbitFormSubmitted", (e) => { alert("Thank you for your submission!"); }); </script></body></html>