Reputation: 2311
I have a jsp page which when submitted takes somewhere around 5 mins to go to the next page process and come back if there are several items to be submitted.
During that time the status bar shows a loading status until it can move to the submitted page.
In the mean time the user is free to click any buttons he likes.
I would like to freeze the jsp page during this time so that the user will not be able to click any butoons during this interval.
How can I achieve the same.
A small snippet:
<html>
<script type="text/javascript">
function submit page()
{
document.forms["submitForm"].submit();
}
</script>
<body>
<form name="submitForm" action"newPage.jsp" method="post">
<input type="button" onclick="page()"/>
</form>
The iframe iin which all the jsp's are displayed is as shown:
<iframe id="Content" name="Content" style="width:100%; height:100%; border:0; background: #green;" scrolling="yes" src="Start.jsp"></iframe>
</body>
</html>
Upvotes: 4
Views: 2429
Reputation: 40338
you can use .blockUI() plug in jQuery
It is a nice plugin to do that
function submit page()
{
$.blockUI({
css: {
top: 0,
left: 0,
width: '100%'
}
});
document.forms["submitForm"].submit();
}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<script src="http://malsup.github.com/jquery.blockUI.js"></script>
see here for details
Upvotes: 3