我想问下比如我一个页面有多个按钮,没有使用form,我用的dwr方法去取值的~~~有没有什么办法比如我点击搜索按钮,所有的按钮都无法点击,知道搜索结束之后,又恢复可以点击。
或者当点击一个搜索按钮或者更新按钮的时候整个页面不能动,或者跳出一个alert显示“请稍后”。当搜索完成之后alert的框自动消失,然后全部恢复正常?
请高人指点下吧~~~最好能给点代码让我了解下~~~谢谢大家了
------解决方案--------------------------------------------------------
jquery来防止重复提交
http://ejb-wawa.iteye.com/blog/188547
------解决方案--------------------------------------------------------
- HTML code
<html><head> <title>Untitled</title> <script language="javascript"> function _click() { waiting(); setTimeout("reload()", 1000); } function reload() { divModal.style.display = "none"; divProgressDialog.style.display = "none"; } function waiting(){ divModal.style.display = ""; divModal.style.width = document.body.scrollWidth; divModal.style.height = document.body.scrollHeight; divProgressDialog.style.display = ""; divProgressDialog.style.left = ((document.body.offsetWidth - divProgressDialog.offsetWidth) / 2); divProgressDialog.style.top = ((document.body.offsetHeight - divProgressDialog.offsetHeight) / 2); } </script></head><body><input id="btn" name="btn" type="button" value="Search" onclick="_click();" /><input id="sexMale" style="width:20px;" type="radio" checked="checked" name="Sex" value="0"/>男<input id="sexMale" style="width:20px;" type="radio" name="Sex" value="1"/>女</p><DIV STYLE="FONT-SIZE: 8pt; Z-INDEX: ? FONT-FAMILY: Tahoma; POSITION: absolute; DISPLAY: none; CURSOR: default" ID="divProgressDialog" dir="ltr"> <DIV STYLE="PADDING: 3px;FONT-WEIGHT: bolder;COLOR:rgb(255, 0, 0)"> Loading......Please waitting......</DIV> </DIV> <DIV ID="divModal" STYLE="BORDER-TOP: white 1px groove; PADDING-BOTTOM: 5px; PADDING-TOP: 3px; BACKGROUND-COLOR: buttonface; TEXT-ALIGN: center; BACKGROUND-COLOR: white; FILTER: alpha(opacity=75); LEFT: 0px; POSITION: absolute; TOP: 1px; Z-INDEX: 3; DISPLAY: none;"> </DIV></body></html>