make selectPlan available in compressed files
This commit is contained in:
parent
92af0a9627
commit
384c626adb
1 changed files with 19 additions and 0 deletions
|
|
@ -28,6 +28,25 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
window.priceCalculator = new PriceCalculator();
|
window.priceCalculator = new PriceCalculator();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Global function for traditional plan selection (used by template buttons)
|
||||||
|
function selectPlan(element) {
|
||||||
|
const planId = element.getAttribute('data-plan-id');
|
||||||
|
const planName = element.getAttribute('data-plan-name');
|
||||||
|
|
||||||
|
// Find the plan dropdown in the contact form
|
||||||
|
const planDropdown = document.getElementById('id_choice');
|
||||||
|
if (planDropdown) {
|
||||||
|
// Find the option with matching plan id and select it
|
||||||
|
for (let i = 0; i < planDropdown.options.length; i++) {
|
||||||
|
const optionValue = planDropdown.options[i].value;
|
||||||
|
if (optionValue.startsWith(planId + '|')) {
|
||||||
|
planDropdown.selectedIndex = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
{% endcompress %}
|
{% endcompress %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue