Commit 43262224 authored by Chenu Denis's avatar Chenu Denis

[fix] Dynamic validity set required in other for multiple checkbox

parent ff79b5be
......@@ -15,10 +15,10 @@
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/?var_mode=calcul</supportUrl>
<copyright>Copyright (C) 2018 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>4.7.2</version>
<version>4.7.3</version>
<apiVersion>3</apiVersion>
<description><![CDATA[<strong>LimeSurvey Bootstrap Vanilla Survey Theme with Accessibility and Options</strong><br>Base on vanilla theme, usage of more aria, fix some role and aria from core.<br>Allow usage of a lot of variations, list of variation can be updated. Some decoration option using boostrap class.]]></description>
<last_update>2019-03-28 16:53:01</last_update>
<last_update>2019-05-12 12:02:46</last_update>
<extends>vanilla</extends>
</metadata>
......
......@@ -47,7 +47,7 @@ var TemplateAccessible = {
},
setMandatoryRequired: function() {
$("[id^='question'].mandatory").each(function() {
$(this).find('.text-item:not(.slider-item) input:text,.text-item textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
$(this).find('.text-item:not(.other-text-item):not(.slider-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
});
},
setDynamicValidity : function () {
......@@ -73,19 +73,19 @@ var TemplateAccessible = {
triggerRelevanceValidity: function() {
$(document).on('relevance:on',"[id^='question'].mandatory",function(event,data) {
if(event.target != this) return;
$(this).find('.text-item input:text,.text-item textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
$(this).find('..text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
});
$(document).on('relevance:off',"[id^='question'].mandatory",function(event,data) {
if(event.target != this) return;
$(this).find('.text-item input:text,.text-item textarea,.dropdown-item select,.radio-item input:radio').removeAttr('required');
$(this).find('.text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').removeAttr('required');
});
$("[id^='question'].mandatory").on('relevance:on',"[id^='javatbd']",function(event,data) {
if(event.target != this) return;
$(this).find('input:text,textarea,select,input:radio').attr('required',true);
$(this).find('.text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').attr('required',true);
});
$("[id^='question'].mandatory").on('relevance:off',"[id^='javatbd']",function(event,data) {
if(event.target != this) return;
$(this).find('input:text,textarea,.select,input:radio').removeAttr('required');
$(this).find('.text-item:not(.other-text-item) input:text,.text-item:not(.other-text-item) textarea,.dropdown-item select,.radio-item input:radio').removeAttr('required');
});
},
triggerHtmlUpdated : function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment