Commit 27120351 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] TemplateAccessible : Potential required on hidden subquestions

parent 933ec134
......@@ -16,7 +16,7 @@
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/</supportUrl>
<copyright>Copyright (C) 2018-2019 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>8.0.3</version>
<version>8.1.0</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>
<extends>vanilla</extends>
......
......@@ -75,19 +75,27 @@ var TemplateAccessible = {
triggerRelevanceValidity: function() {
$(document).on('relevance:on',"[id^='question'].mandatory",function(event,data) {
if(event.target != this) return;
$(this).find(TemplateAccessible.requiredSelector).attr('required',true);
$(this).find(TemplateAccessible.requiredSelector).prop('required',true);
});
$(document).on('relevance:off',"[id^='question'].mandatory",function(event,data) {
if(event.target != this) return;
$(this).find(TemplateAccessible.requiredSelector).removeAttr('required');
$(this).find(TemplateAccessible.requiredSelector).prop('required',false);
});
$("[id^='question'].mandatory").on('relevance:on',"[id^='javatbd']",function(event,data) {
$(document).on('relevance:on',"[id^='question'].mandatory [id^='javatbd']",function(event,data) {
if(event.target != this) return;
$(this).find(TemplateAccessible.requiredSelector).attr('required',true);
if($(this).hasClass('dropdown-item')) {
$(this).find("select").prop('required',true);
}
if($(this).hasClass('radio-item')) {
$(this).find("input:radio").prop('required',true);
}
if($(this).hasClass('text-item') && !$(this).hasClass('other-text-item') && !$(this).hasClass('slider-item') && !$(this).hasClass('comment-item')) {
$(this).find("input:text, textarea").prop('required',true);
}
});
$("[id^='question'].mandatory").on('relevance:off',"[id^='javatbd']",function(event,data) {
$(document).on('relevance:off',"[id^='question'].mandatory [id^='javatbd']",function(event,data) {
if(event.target != this) return;
$(this).find(TemplateAccessible.requiredSelector).removeAttr('required');
$(this).find("input:text, select, input:radio").prop('required',false);
});
},
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