apply patch proposed by 2web to properly remove hidden input set to represent the button used to submit the form, so forms may be properly reused after a post
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 Jan 2010 18:26:22 +0100
changeset 4274 4601ba407ed6
parent 4273 183cd0df6f1a
child 4275 1084aaa53a25
child 4276 e2ed81c20e74
apply patch proposed by 2web to properly remove hidden input set to represent the button used to submit the form, so forms may be properly reused after a post
web/data/cubicweb.edition.js
--- a/web/data/cubicweb.edition.js	Tue Jan 19 18:22:05 2010 +0100
+++ b/web/data/cubicweb.edition.js	Tue Jan 19 18:26:22 2010 +0100
@@ -414,12 +414,15 @@
 function postForm(bname, bvalue, formid) {
     var form = getNode(formid);
     if (bname) {
-	form.appendChild(INPUT({type: 'hidden', name: bname, value: bvalue}));
+	var child = form.appendChild(INPUT({type: 'hidden', name: bname, value: bvalue}));
     }
     var onsubmit = form.onsubmit;
     if (!onsubmit || (onsubmit && onsubmit())) {
 	form.submit();
     }
+    if (bname) {
+	jQuery(child).remove(); /* cleanup */
+    }
 }