Browse Source

- Non mandatory fields can be empty, even if a validation pattern was specified.

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@434 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 15 years ago
parent
commit
8c86f98b93
1 changed files with 5 additions and 0 deletions
  1. 5 0
      js/forms-json-utils.js

+ 5 - 0
js/forms-json-utils.js

@@ -155,6 +155,11 @@ function ValidateField(sFieldId, sPattern, bMandatory, sFormId)
 	{
 		bValid = false;
 	}
+	else if ((currentVal == '') || (currentVal == 0))
+	{
+		// An empty field is Ok...
+		bValid = true;
+	}
 	else if (sPattern != '')
 	{
 		re = new RegExp(sPattern);