Author: michiel
Date: 2010-03-08 18:07:46 +0100 (Mon, 08 Mar 2010)
New Revision: 41293

Modified:
   
mmbase/branches/MMBase-1_9/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
Log:
details, required strings should not have length 0. That is how it works server 
side too.

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-03-08 16:32:37 UTC (rev 41292)
+++ 
mmbase/branches/MMBase-1_9/base-webapp/src/main/webapp/mmbase/validation/validation.js.jsp
  2010-03-08 17:07:46 UTC (rev 41293)
@@ -322,8 +322,8 @@
  */
 MMBaseValidator.prototype.lengthValid = function(el) {
     var length = this.getLength(el);
-    if (! this.isRequired(el) && this.enforce(el, el.mm_isrequired_enforce) && 
length == 0) {
-        return true;
+    if (this.isRequired(el) && this.enforce(el, el.mm_isrequired_enforce) && 
length == 0) {
+        return false;
     }
     var xml = this.getDataTypeXml(el);
 
@@ -880,7 +880,7 @@
         return true; // not yet supported
     }
 
-    if (! this.isString(el)) { // For Strings, you cannot enter 'null'. The 
empty stirng is interpreted as "" in
+    if (! this.isString(el)) { // For Strings, you cannot enter 'null'. The 
empty string is interpreted as "" in
                                // stead. So skip the 'required' checks.
         if (this.isRequired(el) && this.enforce(el, el.mm_isrequired_enforce)) 
{
             if (this.getLength(el) <= 0 && (value === "" || value == null)) {

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to