ily.li/assets/js/url-shortener.js
2020-07-06 10:49:18 +02:00

12 lines
408 B
JavaScript

document.addEventListener('DOMContentLoaded', () => {
const form = document.getElementById('url-shortener-form');
if (!form) return;
const autogenUrlCheckbox = document.getElementById('field-autogen_url');
const slugField = document.getElementById('field-slug');
autogenUrlCheckbox.addEventListener('change', () => {
slugField.disabled = autogenUrlCheckbox.checked;
});
});