diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-05-29 12:44:31 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-05-29 12:44:31 -0400 |
commit | 72f0b5eb660181f57a2cae08b3bec54ae2b543e7 (patch) | |
tree | 1f5fac0828731fd598a24d7b5361ebc38e203a66 /lib/js | |
parent | d08b89fd32f79f2b24bb3f018d5db499f0751518 (diff) |
Properly handle form textboxes that have sources
Diffstat (limited to 'lib/js')
-rw-r--r-- | lib/js/urweb.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 5a6ce21f..a3ab6fde 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -461,7 +461,8 @@ function dyn(pnode, s) { populate(x); } -function input(x, s, recreate, type) { +function input(x, s, recreate, type, name) { + if (name) x.name = name; if (type) x.type = type; x.dead = false; x.signal = ss(s); @@ -473,9 +474,9 @@ function input(x, s, recreate, type) { return x; } -function inp(s) { +function inp(s, name) { var x = input(document.createElement("input"), s, - function(x) { return function(v) { if (x.value != v) x.value = v; }; }); + function(x) { return function(v) { if (x.value != v) x.value = v; }; }, null, name); x.value = s.data; x.onkeyup = function() { sv(s, x.value) }; |