We have a large application with about a 100 jsp pages. When we submit a form (using javascript), the cursor does not change. Is there a way to dynamically intercept the form submit and change the cursor using jquery? Unfortunately, a selector using a named form may not be possible; also, want to keep the function generic for all forms by including it in a common js file.
I tried the following code, but did not work. Is there a way to have a selector similar to what I'm trying below?
function cursorwait(e) {
document.body.className = 'wait';
}
$(function () {
var jspform = $('form');
var fmsubmit = jspform.onsubmit;
jspform.onsubmit = function () {
cursorwait();
if (fmsubmit) {
fmsubmit.call(jspform);
}
}
});