Skip to content

Instantly share code, notes, and snippets.

@cmaggiulli
Created July 22, 2018 22:06
Show Gist options
  • Save cmaggiulli/cd202810c47832fea6b0aa8e9c5a3b87 to your computer and use it in GitHub Desktop.
Save cmaggiulli/cd202810c47832fea6b0aa8e9c5a3b87 to your computer and use it in GitHub Desktop.
Example of using Liferays JavaScript SDK to create a capslock validator
<aui:script use="aui-base">
var password = A.one('#<portlet:namespace />password');
if (password) {
password.on(
'keypress',
function(event) {
Liferay.Util.showCapsLock(event, '<portlet:namespace />passwordCapsLockSpan');
}
);
}
</aui:script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment