From d82b1ce3c53cbd5d10f4e0af1f6577e180ecfb4d Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 22 Nov 2009 17:57:15 -0500 Subject: Proper initial values of dynamic checkboxes in IE --- lib/js/urweb.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 4ee7be4b..c37ff07d 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -481,8 +481,8 @@ function sel(s, content) { function chk(s) { var x = input(document.createElement("input"), s, function(x) { return function(v) { if (x.checked != v) x.checked = v; }; }, "checkbox"); - x.checked = s.data; - x.onchange = function() { sv(s, x.checked) }; + x.defaultChecked = x.checked = s.data; + x.onclick = function() { sv(s, x.checked) }; return x; } -- cgit v1.2.3