Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
1040:ca5136105c45 | 1041:0d767c8d2923 |
---|---|
479 } | 479 } |
480 | 480 |
481 function chk(s) { | 481 function chk(s) { |
482 var x = input(document.createElement("input"), s, | 482 var x = input(document.createElement("input"), s, |
483 function(x) { return function(v) { if (x.checked != v) x.checked = v; }; }, "checkbox"); | 483 function(x) { return function(v) { if (x.checked != v) x.checked = v; }; }, "checkbox"); |
484 x.checked = s.data; | 484 x.defaultChecked = x.checked = s.data; |
485 x.onchange = function() { sv(s, x.checked) }; | 485 x.onclick = function() { sv(s, x.checked) }; |
486 | 486 |
487 return x; | 487 return x; |
488 } | 488 } |
489 | 489 |
490 function addOnChange(x, f) { | 490 function addOnChange(x, f) { |