Clean up from #3255

This logic could have been placed in the ValidationException class or the framework.js file. It seems more fitting for it to be in the framework.js file.
This commit is contained in:
Samuel Georges 2017-11-22 07:12:00 +11:00
parent c165fc02d7
commit 2092454343

View File

@ -242,8 +242,7 @@ if (window.jQuery.request !== undefined) {
var isFirstInvalidField = true
$.each(fields, function focusErrorField(fieldName, fieldMessages) {
fieldName = fieldName.replace(/\.(\w+)/g, '[$1]');
fieldName = fieldName.replace(/\.(\w+)/g, '[$1]')
var fieldElement = $form.find('[name="'+fieldName+'"], [name="'+fieldName+'[]"], [name$="['+fieldName+']"], [name$="['+fieldName+'][]"]').filter(':enabled').first()
if (fieldElement.length > 0) {