Author: michiel
Date: 2010-02-09 16:08:21 +0100 (Tue, 09 Feb 2010)
New Revision: 40940
Modified:
mmbase/branches/MMBase-1_9/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
Log:
MMB-1928
Modified:
mmbase/branches/MMBase-1_9/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
===================================================================
---
mmbase/branches/MMBase-1_9/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
2010-02-09 14:55:23 UTC (rev 40939)
+++
mmbase/branches/MMBase-1_9/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
2010-02-09 15:08:21 UTC (rev 40940)
@@ -66,8 +66,10 @@
el.lastChange = new Date(0);
}
if (new Date(validator.checkAfter + el.lastChange.getTime()) <
now) {
+ el.serverValidated = true;
validator.validateElement(validator.activeElement, true,
true);
} else {
+ //console.log("not yet stale enough");
}
}
}
@@ -398,8 +400,13 @@
MMBaseValidator.prototype.isNumeric = function(el) {
if (el.mm_isnumeric != null) return el.mm_isnumeric;
el.mm_isnumeric = this.hasJavaClass(el,
"org\.mmbase\.datatypes\.NumberDataType");
- return el.isnumeric;
+ return el.mm_isnumeric;
}
+MMBaseValidator.prototype.isBoolean = function(el) {
+ if (el.mm_isboolean != null) return el.mm_isboolean;
+ el.mm_isboolean = this.hasJavaClass(el,
"org\.mmbase\.datatypes\.BooleanDataType");
+ return el.mm_isboolean;
+}
MMBaseValidator.prototype.isInteger = function(el) {
if (el.mm_isinteger != null) return el.mm_isinteger;
el.mm_isinteger = this.hasJavaClass(el,
"(org\.mmbase\.datatypes\.IntegerDataType|org\.mmbase\.datatypes\.LongDataType)");
@@ -742,6 +749,10 @@
} else {
value = parseFloat(value);
}
+ } else if (this.isBoolean(el)) {
+ if ("checkbox" === el.type) {
+ value = $(el).is(":checked");
+ }
}
return value;
}
@@ -1159,7 +1170,7 @@
case "radio":
case "checkbox":
- $(entry).bind("click", function(ev) { self.lastChange(ev);
self.validate(ev); });
+ $(entry).bind("click", function(ev) { self.setLastChange(ev);
self.validate(ev); });
$(entry).bind("blur", function(ev) { self.serverValidate(ev); });
break;
case "file":
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs