document.addEventListener('DOMContentLoaded', function() { setTimeout(function() { //…
- User
document.addEventListener('DOMContentLoaded', function() { setTimeout(function() { // Parse the URL query parameters var params = new URLSearchParams(window.location.search);
// Get the ‘product’ parameter from the URL var product = params.get('product'); // Check if the product parameter exists and not null if (product) { // Set the dropdown value to match the product parameter var selectElement = document.querySelector('select[name="Scanner intra-oral"]'); Array.from(selectElement.options).forEach(function(optionElement) { optionElement.selected = optionElement.value === product; }); }}, 100); // Wait for 1 second });
dont works with this link https://erp.3ddentalstore.fr/formulaire-demande-de-devis-de-scanner-intra-oral?product=Medit+i700?utm_medium=Youtube+Ads
- Assistant
It seems like there are a couple of issues with the code and URL that you provided:
- There's an error in your URL: You have two question marks (
?) which is not standard for query parameters. The second question mark should be an ampersand (&) if you want to add additional parameters after . The correct URL format would be:
- There's an error in your URL: You have two question marks (