问题
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