Unable to display GIF while submitting form after parsley validation

会有一股神秘感。 提交于 2019-12-11 16:00:15

问题


I want to display GIF on form submitting after parsley is a success, so the condition is only after submitting form field and validation in the success I need to show gif only when the form is submitting

I tried

$(document).ready(function () {
     $('#adform').parsley({
              trigger: 'change',
              successClass: "is-valid",
              errorClass: "is-invalid text-danger",
              errorsWrapper: '<div class="input-group"></div>',
              errorTemplate: '<small class="form-text text-danger"></small>',
     });
 })
       .submit('form:submit', function () {
            $("#subloa").css("display", "block");
        });

but doesn't trigger validation.

so how do I show GIF in parsley?


回答1:


Try

$(document).ready(function () {
     $('#adform').parsley({
              trigger: 'change',
              successClass: "is-valid",
              errorClass: "is-invalid text-danger",
              errorsWrapper: '<div class="input-group"></div>',
              errorTemplate: '<small class="form-text text-danger"></small>',
     })
       .on('form:submit', function () {
            $("#subloa").css("display", "block");
        });
});


来源:https://stackoverflow.com/questions/57258687/unable-to-display-gif-while-submitting-form-after-parsley-validation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!