mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
9c2f4e3c44
commit
53c84d93da
@ -92,7 +92,10 @@
|
||||
fields.not(':radio,:checkbox').bind('change.changetracker', onchange);
|
||||
fields.each(function() {
|
||||
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 {
|
||||
origVal = $(this).val();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user