do not wipe a good value if input is bad and cancelled 3.5
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 17 Sep 2009 16:16:00 +0200
branch3.5
changeset 3294 5047b2566634
parent 3292 70c0dd1c3b7d
child 3297 09fd65114a11
child 3299 cb543d6bd0e6
do not wipe a good value if input is bad and cancelled
web/data/cubicweb.edition.js
--- a/web/data/cubicweb.edition.js	Thu Sep 17 14:53:18 2009 +0200
+++ b/web/data/cubicweb.edition.js	Thu Sep 17 16:16:00 2009 +0200
@@ -481,10 +481,10 @@
 	return false;
     }
     d.addCallback(function (result, req) {
-        handleFormValidationResponse(divid+'-form', noop, noop, result);
-	if (reload) {
+        if (handleFormValidationResponse(divid+'-form', noop, noop, result)) {
+          if (reload) {
 	    document.location.href = result[1].split('?')[0];
-	} else {
+	  } else {
 	    var fieldview = getNode('value-' + divid);
 	    // XXX using innerHTML is very fragile and won't work if
 	    // we mix XHTML and HTML
@@ -494,7 +494,8 @@
 		// hide global error messages
 		hideInlineEdit(eid, rtype, divid);
 	    }
-	}
+	  }
+        }
 	return false;
     });
     return false;