Commit 49d2cedf authored by Chenu Denis's avatar Chenu Denis

[fix] Remove data-disable-check-validity, validity is done for movenext or movesubmit

Plugoin can use data-enablevalidation on button if needed
parent 7ad4c484
......@@ -21,7 +21,13 @@ var TemplateAccessible = {
this.triggerRelevanceOnOff();
},
disableValidityCheck: function() {
$(document).on("click","button[data-disable-check-validity]",function(event,data) {
$(document).on("click","button",function(event,data) {
if($(this).attr('name') == 'move' && ($(this).attr('value') == 'movenext' || $(this).attr('value') == 'movesubmit' )) {
return;
}
if($(this).data('enablevalidation')) {
return;
}
$("form#limesurvey").find(":required").removeAttr("required");
$("form#limesurvey").find(":invalid").each(function(){
$(this)[0].setCustomValidity('');
......
......@@ -3,6 +3,6 @@
<label class="form-group {{ aSurveyInfo.class.clearalllabel }}" for="clear-all-id{{ navigatorid }}" >
<input {{ aSurveyInfo.attr.clearallconfirm }} class="{{ aSurveyInfo.class.clearallconfirm }}" id="clear-all-id{{ navigatorid }}" ><span class="control-label">{{gT("Please confirm you want to clear your response?")}}</span>
</label>
<button aria-labelled-by="clear-all-id{{ navigatorid }}" data-disable-check-validity=1 value="clearall" name="clearall" type="submit" data-confirmedby="confirm-clearall" class="{{ aSurveyInfo.class.clearallbutton }} btn btn-link">{{gT("Exit and clear survey")}}</button>
<button aria-labelled-by="clear-all-id{{ navigatorid }}" value="clearall" name="clearall" type="submit" data-confirmedby="confirm-clearall" class="{{ aSurveyInfo.class.clearallbutton }} btn btn-link">{{gT("Exit and clear survey")}}</button>
</div>
{% endif %}
\ No newline at end of file
{% endif %}
......@@ -9,12 +9,12 @@
{# On last page, Next button become submit button. #}
{% if aNavigator.aMoveNext.value == "movesubmit" %}
<!-- Button submit -->
<button data-check-validity=1 {{ str_replace("ls-button-submit","ls-button-submit"~navigatorid,aSurveyInfo.attr.navigatorbuttonsubmit) }} class=" {{ aNavigator.disabled }} btn btn-lg btn-primary">
<button {{ str_replace("ls-button-submit","ls-button-submit"~navigatorid,aSurveyInfo.attr.navigatorbuttonsubmit) }} class=" {{ aNavigator.disabled }} btn btn-lg btn-primary">
{{ gT("Submit") }}
</button>
{% else %}
<!-- Button Next -->
<button data-check-validity=1 {{ str_replace("ls-button-submit","ls-button-submit"~navigatorid,aSurveyInfo.attr.navigatorbuttonnext) }} class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonnext }} btn btn-lg btn-primary " >
<button {{ str_replace("ls-button-submit","ls-button-submit"~navigatorid,aSurveyInfo.attr.navigatorbuttonnext) }} class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonnext }} btn btn-lg btn-primary " >
{{ gT("Next") }}
</button>
{% endif %}
......@@ -25,7 +25,7 @@
{# Previous button must be set to ON in survey settings (and it's not shown in first page, in All in One survey mode, etc) #}
{% if aNavigator.aMovePrev.show %}
<!-- Button previous -->
<button data-disable-check-validity=1 {{ str_replace("ls-button-previous","ls-button-previous"~navigatorid,aSurveyInfo.attr.navigatorbuttonprev) }} class=" {{ aNavigator.disabled }} btn btn-lg btn-default " >
<button {{ str_replace("ls-button-previous","ls-button-previous"~navigatorid,aSurveyInfo.attr.navigatorbuttonprev) }} class=" {{ aNavigator.disabled }} btn btn-lg btn-default " >
{{ gT("Previous") }}
</button>
{% endif %}
......
......@@ -18,6 +18,6 @@
{% if attribute(indexItem.stepStatus, 'index-item-current') is defined and attribute(indexItem.stepStatus, 'index-item-current') == true %}
{% set templateClass = statusClass ~ ' disabled' %}
{% endif %}
<button data-disable-check-validity=1 type="submit" name="move" value="{{ indexItem.step }}" class="list-group-item {{ indexItem.coreClass }} {{ templateClass }}" >{{ indexItem.text }}</button>
<button type="submit" name="move" value="{{ indexItem.step }}" class="list-group-item {{ indexItem.coreClass }} {{ templateClass }}" >{{ indexItem.text }}</button>
{% endfor %}
</div>
......@@ -23,7 +23,7 @@
{% if attribute(indexQuestion.stepStatus, 'index-item-current') is defined and attribute(indexQuestion.stepStatus, 'index-item-current') == true %}
{% set templateClass = statusClass ~ ' disabled' %}
{% endif %}
<button data-disable-check-validity=1 type="submit" name="move" value="{{ indexQuestion.step }}" class="list-group-item {{ indexQuestion.coreClass }} {{ templateClass }}" data-qid="{{ indexQuestion.qid }}">
<button type="submit" name="move" value="{{ indexQuestion.step }}" class="list-group-item {{ indexQuestion.coreClass }} {{ templateClass }}" data-qid="{{ indexQuestion.qid }}">
{{ ellipsizeString(indexQuestion.text, 80, 0.6, "…" ) }}
</button>
{% endfor %}
......
......@@ -4,10 +4,10 @@
This file render the load or save buttons without javascript needed
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" %}
<button data-disable-check-validity=1 {{ aSurveyInfo.attr.loadbutton }} class="{{ aSurveyInfo.class.loadbutton }} action--ls-button-submit btn btn-default">{{ gT("Load unfinished survey") }}</button>
<button {{ aSurveyInfo.attr.loadbutton }} class="{{ aSurveyInfo.class.loadbutton }} action--ls-button-submit btn btn-default">{{ gT("Load unfinished survey") }}</button>
{% endif %}
{% if aSurveyInfo.aNavigator.save.show == "Y" %}
<button data-disable-check-validity=1 {{ aSurveyInfo.attr.savebutton }} class='{{ aSurveyInfo.class.savebutton }} action--ls-button-submit btn btn-default'>
<button {{ aSurveyInfo.attr.savebutton }} class='{{ aSurveyInfo.class.savebutton }} action--ls-button-submit btn btn-default'>
{{ gT('Resume later') }}
</button>
{% endif %}
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