if(!/\D/.test(currentFieldValue) && currentFieldValue.length >= 8)
Any reason to using (!/\D/ instead of /\d/ and just use .search instead of .test and just specifiy number of digits with [8] instead of using length?
if (currentFieldValue.indexOf("@")>=0)
This is a very primitive validation. Should use regular expression so it can be expanded to also test if the domain contains "." and if the left side and right side of "@" at least contain some character. There also may have been some restriction on the left side starting with a character. I think there was a validation check using regular expression in liferay already and it may just be a matter of copying it.
Please sign in to flag this as inappropriate.