I'm writing a webserver app in clojure with Hiccup (and other things). I'm trying to have a check-box enable and disable two drop-down fields with a little JS but I can't make it work.
[:head
[:script "function toggleText(cb, t1, t2) {
document.getElementById(t1).disabled = !cb.checked;
document.getElementById(t2).disabled = !cb.checked;
}"]]
[:td (hf/check-box {:on-change (str "toggleText(" (name endtag) "," (name tytag) "," (name tmtag) ")")} endtag)]
[:td (hf/drop-down tytag (range 2013 2031) 2017)]
[:td (hf/drop-down tmtag (range 1 13) 6)]
cljs->js
macro, also known as#js
. – Dewan