I'm trying to add something to this JS, for a successfully working submit Form:
$('#upload-form form').ajaxForm({
url: '{{LINK aj/ffmpeg-submit}}?hash=' + $('.main_session').val(),
beforeSend: function() {
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
}, success: function(data) {
if (data.status == 200) {
window.location.href = data.link;
}
to get a message to display before the Form submits, I added:
$(".loading_msg").show();
into the beforeSend: function, like so:
beforeSend: function() {
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
$(".loading_msg").show();
return false;
Had to add return:false because after 'show' it was submitting too fast to read the message.
My code stops the submission, so the message can be read. How can the submission then be un-stopped upon the reader closing the message?
I have this:
<div class="loading_msg" style="display:none"> MESSAGE!! <span class="closebtn" onclick="this.parentElement.style.display='none';">×</span> </div>
and this:
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
$(".loading_msg").show();
return false;
Tried these without success:
$('#upload-form form').ajaxForm({
url: '......,
beforeSend: function() {
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
$('.loading_msg').show()
$('.loading_msg').click(function () {
return true
});
and this:
$('#upload-form form').ajaxForm({
url: '........,
beforeSend: function() {
$('#submit-btn').attr('disabled', true);
$('#submit-btn').val("{{LANG please_wait}}");
$('#submit-btn').click(function (event) {
event.preventDefault()
$('.loading_msg').show()
})
$('.loading_msg').click(function () {
$('#upload-form form').submit()
})
any help is appreciated to show the message and allow the reader of the message to close it which will cause the form to submit.