Hidden Element (Forms) - Customer_id example

by support_tint

HTML

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
    <!-- Asynchronously load the Tint script -->
    <script async src="https://www.tintup.com/app/dist/tint.js"></script>

    <script>
        // Create a new div element to hold the Tint form
        const tintForm = document.createElement('div');

        // Set the teamId attribute to your team's ID
        tintForm.dataset.teamId = 374768; // Paste your teamID here

        // Set the formId attribute to your form's ID
        tintForm.dataset.formId = 1765; // Paste your form ID here

        // Set the formValues attribute with the Customer ID value
        // Note: Replace 'CUSTOMER_ID' with the actual customer ID value passed from your code
        tintForm.dataset.formValues = (new URLSearchParams({ customer_id: 'CUSTOMER_ID' })).toString(); 

        // Append the newly created div after the current script
        document.currentScript.after(tintForm);
    </script>
</body>
</html>