<?php
// Copyright 1999-2021. Plesk International GmbH. All rights reserved.
?>
<?php echo $this->form; ?>

<script type="text/javascript">
//<![CDATA[
(function () {
    var updateControlsState = function () {
        var addonPlanSelector = document.getElementById('subscriptionInfo-addonPlanSelector');
        if ('0' === document.getElementById('subscriptionInfo-servicePlan').value) {
            if (addonPlanSelector) {
                addonPlanSelector.closest('.form-row').style.display = 'none';
            }
            document.getElementById('subscriptionInfo-customize').checked = true;
        } else {
            if (addonPlanSelector) {
                addonPlanSelector.closest('.form-row').style.display = '';
            }
            document.getElementById('subscriptionInfo-customize').checked = false;
        }
    }

    if (document.getElementById('subscriptionInfo-servicePlan')) {
        updateControlsState();
        document.getElementById('subscriptionInfo-servicePlan').addEventListener('change', updateControlsState);
    }
})();
//]]>
</script>
