// Populate Page URL dynamically function populatePageUrl() { const pageUrlField = document.getElementById('PageUrl'); if (pageUrlField) { pageUrlField.value = window.location.href; } }
// Populate Product Name dynamically (if needed) function populateProductName(productName) { const productNameField = document.getElementById('ProductsName'); if (productNameField) { productNameField.value = productName || ''; } }
// Initialize reCAPTCHA and populate fields on page load document.addEventListener('DOMContentLoaded', function () { populatePageUrl(); populateProductName('Your Default Product Name'); // Replace with dynamic product name if required initializeRecaptcha(); });