当前位置: 代码迷 >> Web前端 >> form中button旋钮提交到不同的action
  详细解决方案

form中button旋钮提交到不同的action

热度:116   发布时间:2012-08-21 13:00:22.0
form中button按钮提交到不同的action

?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
?//重新计算按钮提交
???function accountMonth(){
?????document.caozuo.action="wage.do?operate=accountMonth ";
??document.caozuo.submit();
??alert(document.caozuo.action);
???}
???//保存记录提交
??????function saveWageTohistory(){
?????document.caozuo.action="wage.do?operate=SaveWageTohistory";
??document.caozuo.submit();
??alert(document.caozuo.action);
???}
</script>
</head>

<body>
<form action="" method="post" name="caozuo">
<input type="button" value="重新计算" onclick="accountMonth()" class="botton"/>
<input type="button" value="保存记录" onclick="saveWageTohistory()" class="botton"/>
</form>
</body>
</html>

  相关解决方案