diff --git a/assets/js/element-form/initialisation.js b/assets/js/element-form/initialisation.js index bceefe1bf13d4ac49cdc4db45bb32038874d571e..3c2bb17ba00b610abe6c12ac2cdc40b6cd4173f5 100755 --- a/assets/js/element-form/initialisation.js +++ b/assets/js/element-form/initialisation.js @@ -42,10 +42,10 @@ jQuery(document).ready(function() initializeToHtml() // Checkboxes, use custom checked value - $('input[type=checkbox]').change(function() { + $('input[type=checkbox][data-checked-value]').change(function() { if ($(this).val() == 'on' && $(this).data('checked-value') != 'on') $(this).val($(this).data('checked-value')) - }) + }).trigger('change') // TIMEPICKERS $('.timepicker').each(function(e) { diff --git a/src/Controller/ElementFormController.php b/src/Controller/ElementFormController.php index 6db16081ae5bed39d8fa6806bd4cb5c00db6b26e..3251e4ef5f6956b27b664658f0a3fb90247c77af 100755 --- a/src/Controller/ElementFormController.php +++ b/src/Controller/ElementFormController.php @@ -295,14 +295,14 @@ class ElementFormController extends GoGoController $isAllowedPending = $configService->isUserAllowed('pending'); - $showResultLink = 'stayonform' == $submitOption && ($isAllowedDirectModeration || $isAllowedPending); + $showResultLink = $submitOption == 'stayonform' && ($isAllowedDirectModeration || $isAllowedPending); if ($showResultLink) { $noticeText .= '</br><a href="'.$elementShowOnMapUrl.'">Voir le résultat sur la carte</a>'; } $session->getFlashBag()->add('success', $noticeText); - if ('stayonform' != $submitOption && !$recopyInfo) { + if ($submitOption != 'stayonform' && !$recopyInfo) { return $this->redirect($elementShowOnMapUrl); }