Closed GoogleCodeExporter closed 9 years ago
This bug was introduced in r2753
In the refactored getValidationValue() we have
(validation3.js @line 1158)
if(Object.isString(value))
return this.trim(value);
else
return value;
which is causing problems because in case of TCheckBox value is null and null
is returned whereas the validation process expects not null value or ""
this check is also redudant because we're calling not trim() but this.trim()
which does the check and ensures correct values:
(validation3.js @line 1058)
trim : function(value)
{
return typeof(value) == "string" ? value.trim() : "";
},
so the introduction of getRawValidationValue() doesn't seem to be well
thought-through because the only thing it does is adding the unneeded
isString() checking and adding this bug
my opinion is we should return to having only getValidationValue()
diff is attached
Original comment by piotrows...@gmail.com
on 3 Nov 2010 at 12:31
Attachments:
TRegularExpressionValidator uses RawValidationValue().
The content of the field was trimmed before the validation as a consequence if
regex was forbidding leading or ending spaces, it would pass clientside
validation.
About the code in getValidationValue, It can't return "" if it's not a 'string'
because Validation value can be a 'date' or an integer...
I would suggest to reproduce the switch/case comportement of previous
getValidationValue() to know if we need to trim or not.
Original comment by E.Let...@gmail.com
on 17 Nov 2010 at 10:15
Attachments:
fixed in r2910. While this was not a big problem when validating a TCheckBox,
it was worst when validating a TActiveCheckBox: you'd get non error report from
the validator at all.
Original comment by ctrlal...@gmail.com
on 11 May 2011 at 2:17
Original issue reported on code.google.com by
rojaro@gmail.com
on 20 Apr 2010 at 2:21