日期:2014-05-16  浏览次数:20398 次

prototype -通过js提交表单,局部刷新不跳转
prototype -通过js提交表单,局部刷新不跳转
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title></title>
   <script type="text/javascript" src="prototype_for_upload.js"></script>
   <script type="text/javascript">

function formSubmit()
{
        $('frmFileUpload').formUpdate({
                  handler:'result', loadingmsg:'请稍候,正在提交...' , fn:updateOpener
                });	
}
 
var updateOpener  = function(result)
{
    //alert("我成功了!");
    //window.location.reload();//重新刷新页面	
}
</script>
	</head>
	<body>
<div id='result'></div>
<form id="frmFileUpload"  name="form1" action="<%=request.getContextPath()%>/hotelManage.do?method=saveHotelImage1" method="post" enctype="multipart/form-data">
<table>............</table>		
</form>

<form id="form2"  name="form2" action="<%=request.getContextPath()%>/hotelManage.do?method=saveHotelImage1" method="post"> <table>............</table>		
</form>

	</body>
</html>