el reemplazo estaba mal

This commit is contained in:
f 2018-07-24 18:02:34 -03:00
parent 586f4c5824
commit 8af9b4a2a5
No known key found for this signature in database
GPG key ID: F3FDAB97B5F9F7E7

View file

@ -39,7 +39,8 @@ $(document).on('turbolinks:load', function() {
_group.find('[name*="['+_own_group+'][0]"]').each(function(i, input) { _group.find('[name*="['+_own_group+'][0]"]').each(function(i, input) {
var _input = $(input); var _input = $(input);
var _name = _input.attr('name'); var _name = _input.attr('name');
_input.attr('name', _name.replace(/\[0\]/, '['+_date+']')); var _regex = new RegExp('\\['+_own_group+'\\]\\[0\\]');
_input.attr('name', _name.replace(_regex, '['+_own_group+']['+_date+']'));
if (['checkbox','radio'].includes(_input.attr('type'))) { if (['checkbox','radio'].includes(_input.attr('type'))) {
_input.prop('checked', false); _input.prop('checked', false);
} else { } else {