在onsubmit事件里直接调用下面这个函数即可,某些细节可自行调整
function
dispProcessing()
{
document.body.style.cursor = ' wait ' ;
var div = document.createElement( " div " );
div.innerHTML = " <br><center><font color="white">正在提交数据,请稍候!</font></center> " ;
div.style.background = " 666666 " ;
div.style.filter = " alpha(Opacity=100) " ;
div.style.width = " 300px " ;
div.style.height = " 80px " ;
div.style.lineHeight = " 30px " ;
div.style.position = " absolute " ;
div.style.top = document.body.clientHeight / 2 - 30 ;
div.style.left = document.body.clientWidth / 2 - 100 ;
div.style.zIndex = 101 ;
document.body.appendChild(div);
var div1 = document.createElement( " div " );
var w, h;
with (document.body){
if (scrollWidth < clientWidth){
w = clientWidth;
} else {
w = scrollWidth;
}
if (scrollHeight < clientHeight){
h = clientHeight;
} else {
h = scrollHeight;
}
}
div1.style.background = " black " ;
div1.style.filter = " alpha(Opacity=20) " ;
div1.style.position = " absolute " ;
div1.style.top = " 0 " ;
div1.style.left = " 0 " ;
div1.style.width = w + " px " ;
div1.style.height = h + " px " ;
div1.style.zIndex = 100 ;
document.body.appendChild(div1);
div1.focus();
var sels = document.getElementsByTagName( " SELECT " );
for ( var i = 0 ; i < sels.length; i ++ ){
sels[i].style.visibility = " hidden " ;
}
}
{
document.body.style.cursor = ' wait ' ;
var div = document.createElement( " div " );
div.innerHTML = " <br><center><font color="white">正在提交数据,请稍候!</font></center> " ;
div.style.background = " 666666 " ;
div.style.filter = " alpha(Opacity=100) " ;
div.style.width = " 300px " ;
div.style.height = " 80px " ;
div.style.lineHeight = " 30px " ;
div.style.position = " absolute " ;
div.style.top = document.body.clientHeight / 2 - 30 ;
div.style.left = document.body.clientWidth / 2 - 100 ;
div.style.zIndex = 101 ;
document.body.appendChild(div);
var div1 = document.createElement( " div " );
var w, h;
with (document.body){
if (scrollWidth < clientWidth){
w = clientWidth;
} else {
w = scrollWidth;
}
if (scrollHeight < clientHeight){
h = clientHeight;
} else {
h = scrollHeight;
}
}
div1.style.background = " black " ;
div1.style.filter = " alpha(Opacity=20) " ;
div1.style.position = " absolute " ;
div1.style.top = " 0 " ;
div1.style.left = " 0 " ;
div1.style.width = w + " px " ;
div1.style.height = h + " px " ;
div1.style.zIndex = 100 ;
document.body.appendChild(div1);
div1.focus();
var sels = document.getElementsByTagName( " SELECT " );
for ( var i = 0 ; i < sels.length; i ++ ){
sels[i].style.visibility = " hidden " ;
}
}