removed isCheckboxGroup check and replace

This commit is contained in:
Christopher Joe 2015-10-01 14:42:29 +13:00
parent d0d511c3a5
commit 6a8a82a287

View File

@ -125,15 +125,11 @@ jQuery(function ($) {
// When a field becomes valid.
success: function (error) {
var errorId = $(error).attr('id'),
fieldId = errorId.substr(0, errorId.indexOf('-error')).replace(/[\\[\\]]/, ''),
isCheckboxGroup = $(error).closest('.requiredField').hasClass('checkboxset');
fieldId = errorId.substr(0, errorId.indexOf('-error')).replace(/[\\[\\]]/, '');
// We need to escapse the field id if it's a checkboxfield
// because jQuery breaks when using selector that end with
// Remove square brackets since jQuery.validate.js uses idOrName,
// which breaks further on when using a selector that end with
// square brackets.
if (isCheckboxGroup) {
fieldId = fieldId.replace('[]', '\\\\[\\\\]');
}
error.remove();