I have a .jsp page that users can enter information and then save it with a save button. The application works, but because the click event of the button is running Java code, which then adds the saved information to an Oracle db, it takes a few moments before the save is complete.
I need a way to show the users a wait cursor so they will know when the save is complete. However, I can't figure out how the .jsp page will know when the Java code has completed.
Here is a snippet:
function updateTrans() {
document.body.style.cursor = 'wait';
if (validateTrans()) {
if(editform.cbFg.checked) {
editform.Fg.value = "Y";
}
else {
editform.Fg.value = "N";
}
editform.myaction.value = "updateTrans";
editform.submit();
document.body.style.cursor = 'default';
}
}
This does not work. I guess the editform.submit(); happens asynchronously.
Please help.
EDIT: The target of editform is a servlet.
EDIT: The servlet is a java page(HttpServlet), not a web page.
editformhave a target? A hidden iframe or something?