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 | c6b4e9ff771cf8e697ea36dd31230c03cacf5442 (patch) | |
tree | 1f5fac0828731fd598a24d7b5361ebc38e203a66 /lib/js/urweb.js | |
parent | 3399aef91b4d4684bf2a2935cffde20e80453673 (diff) |
Properly handle form textboxes that have sources
Diffstat (limited to 'lib/js/urweb.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) }; |