From c6b4e9ff771cf8e697ea36dd31230c03cacf5442 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 29 May 2011 12:44:31 -0400 Subject: Properly handle form textboxes that have sources --- lib/js/urweb.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/js') 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) }; -- cgit v1.2.3