Skip to content

Commit

Permalink
Fixed issue #18133: Set "Other" state has no clue about current state
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieljenik committed Sep 16, 2022
1 parent 18ba234 commit 1374c1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -153,6 +153,12 @@ var onClickListAction = function () {
/* Define what should be done when user confirm the mass action */
/* remove all existing action before adding the new one */
$modalButton.off('click').on('click', function(){
var $form = $modal.find('form');
if ($form.data('trigger-validation')) {
if (!$form[0].reportValidity()) {
return;
}
}

// Custom datas comming from the modal (like sid)
var $postDatas = {sItems:$oCheckedItems};
Expand Down
Expand Up @@ -3,11 +3,15 @@
* Set question group and position modal body (parsed to massive action widget)
*/
?>
<form class="custom-modal-datas form-horizontal">
<form class="custom-modal-datas form-horizontal" data-trigger-validation="true">
<div class="form-group" id="OtherSelection">
<label class="col-sm-4 control-label"><?php eT("Option 'Other':"); ?></label>
<div class="col-sm-8">
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array('name' => 'other', 'value'=> '', 'htmlOptions'=>array('class'=>'custom-data bootstrap-switch-boolean', 'data-gridid'=>'question-grid'), 'onLabel'=>gT('On'),'offLabel'=>gT('Off')));?>
<select class="form-control custom-data attributes-to-update" id="other" name="other" required>
<option value="" selected="selected"><?php eT('Please select an option');?></option>
<option value="false"><?php eT('Off');?></option>
<option value="true"><?php eT('On');?></option>
</select>
</div>
<input type="hidden" name="sid" value="<?php echo (int) Yii::app()->request->getParam('surveyid',0); ?>" class="custom-data"/>
</div>
Expand Down

0 comments on commit 1374c1e

Please sign in to comment.