Hello,
I want to check in if the form validates properly in order to display a "please wait" message.
This is the code I use (and works properly)
I just want an 'if' condition before fading in the message div (#pleasewait) that check if the form validates.
How can I do this?
I want to check in if the form validates properly in order to display a "please wait" message.
This is the code I use (and works properly)
jQuery('#submit_button').click(function() {
jQuery('#submit_button').hide();
jQuery('#pleasewait').fadeIn('slow');
});
I just want an 'if' condition before fading in the message div (#pleasewait) that check if the form validates.
How can I do this?
I have found a workaround here: http://www.chronoengine.com/forums/posts/f2/t96876/loading-message-after-submit.html in case someone else is looking for something like this.
So my final code is:
So my final code is:
var validated = false;
var form = jQuery('#chronoform-get-a-free-quote');
jQuery(document).on('submit', form, function(event){
if ( validated ) {
return;
}
event.stopPropagation();
event.preventDefault();
showMessage();
});
function showMessage(){
jQuery('#submit_button').hide();
jQuery('#pleasewait').fadeIn('slow');
validated = true;
form.submit();
};
Thanks for posting your solution, starting from the next update, the following FAQ should be helpful:
http://www.chronoengine.com/faqs/70-cfv5/5230-validation-customization-in-cfv5.html
Regards,
Max
http://www.chronoengine.com/faqs/70-cfv5/5230-validation-customization-in-cfv5.html
Regards,
Max
This topic is locked and no more replies can be posted.