roy
roy

Reputation: 33

Create a "wait message" in jsp

I need to create a "wait message" in jsp page for x time, after pressing on the button and before the next page opens.

Upvotes: 0

Views: 2035

Answers (1)

Soner Gönül
Soner Gönül

Reputation: 98760

<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.

Upvotes: 1

Related Questions