mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for ALFCOM-586 - trims and ignores leading/trailing whitespace before validation in JSF client forms.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14760 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -127,10 +127,11 @@ function validateName(control, message, showMessage)
|
||||
{
|
||||
var result = true;
|
||||
var pattern = /([\"\*\\\>\<\?\/\:\|]+)|([ ]+$)|([\.]?[\.]+$)/;
|
||||
var idx = control.value.search(pattern);
|
||||
var trimed = control.value.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
|
||||
var idx = trimed.search(pattern);
|
||||
if (idx != -1)
|
||||
{
|
||||
informUser(control, "'" + control.value.charAt(idx) + "' " + message, showMessage);
|
||||
informUser(control, "'" + trimed.charAt(idx) + "' " + message, showMessage);
|
||||
result = false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user