diff --git a/app/templates/listings/form.html b/app/templates/listings/form.html index d1bb6cf..d8b392d 100644 --- a/app/templates/listings/form.html +++ b/app/templates/listings/form.html @@ -66,7 +66,11 @@ var groups = document.querySelectorAll('.attr-group'); function sync(){ groups.forEach(function(g){ - g.style.display = (g.dataset.cat === sel.value) ? 'block' : 'none'; + var visible = g.dataset.cat === sel.value; + g.style.display = visible ? 'block' : 'none'; + g.querySelectorAll('input,select,textarea').forEach(function(el){ + el.disabled = !visible; + }); }); } if (sel){ sel.addEventListener('change', sync); sync(); }