Create a "wait message" in jsp
I need to create a "wait message" in jsp pa开发者_运维百科ge for x time, after pressing on the button and before the next page opens.
<script language="javascript">
function doBeforeSubmit()
{
document.getElementById("displayBeforeSubmit").style.display = "none";
document.getElementById("displayAfterSubmit").style.dispay = "block";
return true; // you must return true or the form will not submit
}
</script>
<div id="displayBeforeSubmit">
<form action="results_page.jsp" method="post"
onsubmit="doBeforeSubmit()">
...
form stuff
...
</form>
</div>
<div id="displayAfterSubmit">
<h3>Please wait...</h3>
</div>
I hope that gives you an idea. In my opinion, you should try this "Please Wait" part in Javascript.
精彩评论