Hello,
I'm having issues with proudmart form, the form submission is somewhat slow and users double click the submit button and this results in multiple email submissions. I have tried to disable the button using javascript without success, can you help me?
sorry, forgot to comment:
Joomla 3.10.2
Virtuemart 3.8.7
You can add the following Javascript to your template to disable the submit button on the form submission.
(function($) {
$(function() {
$('form#askform').on('submit', function() {
$(this).find(':submit').attr('disabled', true);
});
});
})(jQuery);
It has worked, thank you very much. ;D Add it in the script declaration in case someone needs it.
$document->addScriptDeclaration('
jQuery(function($){
$("#askform").validationEngine("attach");
$("#comment").keyup( function () {
var result = $(this).val();
$("#counter").val( result.length );
});
});
jQuery(function($) {
$(function() {
$("form#askform").on("submit", function() {
$(this).find(":submit").attr("disabled", true);
});
});
});
');