Fix changetracker checkbox bugs

1) Use quoted name attribute selector, to work with CheckboxsetField bracketed[] field names
2) Initialize unchecked boxes original values to 0 instead of undefined, as this is the value onchange() expects for unchecked boxes (see line 67)
This commit is contained in:
Brian Cairns 2017-06-12 16:16:55 -06:00
parent 9c2f4e3c44
commit 53c84d93da

View File

@ -92,7 +92,10 @@
fields.not(':radio,:checkbox').bind('change.changetracker', onchange); fields.not(':radio,:checkbox').bind('change.changetracker', onchange);
fields.each(function() { fields.each(function() {
if($(this).is(':radio,:checkbox')) { if($(this).is(':radio,:checkbox')) {
origVal = self.find(':input[name=' + $(this).attr('name') + ']:checked').val(); origVal = self.find(':input[name="' + $(this).attr('name') + '"]:checked').val();
if("undefined" === typeof origVal){
origVal = 0;
}
} else { } else {
origVal = $(this).val(); origVal = $(this).val();
} }