diff lib/js/urweb.js @ 1041:0d767c8d2923

Proper initial values of dynamic checkboxes in IE
author Adam Chlipala <adamc@hcoop.net>
date Sun, 22 Nov 2009 17:57:15 -0500
parents ca5136105c45
children a8a825861397
line wrap: on
line diff
--- a/lib/js/urweb.js	Sun Nov 22 16:40:09 2009 -0500
+++ b/lib/js/urweb.js	Sun Nov 22 17:57:15 2009 -0500
@@ -481,8 +481,8 @@
 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;
 }