I want to show loading image after clicking the submit button using prototype. I want loading image appear after successful validation. I used this code
var dataForm = new VarienForm('form-validate', true);
dataForm.submit = function(button, url) {
if (this.validator.validate()) {
//image code
document.getElementById('processing').style.display = 'block';
}
}.bind(dataForm);
Code flow doesn't go inside dataForm.submit = function(button, url) { .. }
.
Can anyone told me how to do it using prototype?
Best Answer
There are many ways to do this. One of them is to override
submit
method ofVarienForm
class: