From 817ce7421f990d3ee5ed75ebdc0560a22b96837f Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 16 May 2009 16:59:24 -0400 Subject: Fix initialization of cselect from source --- lib/js/urweb.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/js/urweb.js') diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 39701b4d..04c1cfae 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -292,11 +292,13 @@ function inp(t, s, content) { populate(x); addNode(x); if (t == "select") { - x.onchange = function() { sv(s, x.value) }; x.innerHTML = content; - sv(s, x.value); - } else + x.value = s.data; + x.onchange = function() { sv(s, x.value) }; + } else { + x.value = s.data; x.onkeyup = function() { sv(s, x.value) }; + } return x; } -- cgit v1.2.3