diff lib/js/urweb.js @ 1463:607657eb2865

Properly handle form textboxes that have sources
author Adam Chlipala <adam@chlipala.net>
date Sun, 29 May 2011 12:44:31 -0400
parents 17393c5e2b90
children f561025bb68e
line wrap: on
line diff
--- a/lib/js/urweb.js	Sun May 29 12:18:59 2011 -0400
+++ b/lib/js/urweb.js	Sun May 29 12:44:31 2011 -0400
@@ -461,7 +461,8 @@
     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 @@
     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) };