File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
webapp/src/main/webapp/WEB-INF/jsp/fragment Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 201
201
<script type =" text/javascript" >
202
202
PWM_GLOBAL [' startupFunctions' ].push (function (){
203
203
PWM_MAIN .addEventHandler (' <%= loopConfiguration. getName() % >' , ' input' , function (event ) {
204
- event .target .setCustomValidity (" " );
205
- });
206
- PWM_MAIN .addEventHandler (' <%= loopConfiguration. getName() % >' , ' invalid' , function (event ) {
207
- event .target .setCustomValidity (' <%= StringUtil . escapeJS(loopConfiguration. getRegexError(formLocale))% >' );
204
+ var input = event .target ;
205
+ var regexError = ' <%= StringUtil . escapeJS(loopConfiguration. getRegexError(formLocale))% >' ;
206
+ var msg = input .value .search (new RegExp (input .getAttribute (' pattern' ))) >= 0 ? ' ' : regexError;
207
+ input .setCustomValidity (msg);
208
+ input .title = msg;
208
209
});
209
210
});
210
211
</script >
You can’t perform that action at this time.
0 commit comments