怎么用按钮来控制表单的action的路径

在一个表单里有2个按钮,假如一个是“发送简历”按钮,一个是“收藏工作”按钮,按不同的按钮就提交到不同的路径,这个怎么实现??
可以的话,把代码写出来。谢了

可以用js控制 每个按钮在js里设置一个跳转路径就可以了
温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-08-20
<script>
function fsjl(){
//formname是你自己的form的name
formname.action="这里写发送简历的路径";
}
function scgz(){
//formname是你自己的form的name
formname.action="这里写收藏工作的路径";
}
</script>
下面是html代码
<input type="button" name="fsjl" value="发送简历" onclick="fsjl()">
<input type="button" name="scgz" value="收藏工作" onclick="scgz()">
第2个回答  2008-08-20
首先要是按钮,不是submit,在按钮里添加事件onclick等
然后javaScript里写上对应的
formName.action="发送简历Path";
formName.action="收藏工作Path";
就好的
第3个回答  2008-08-20
submit提交到action,然后action判断的你的submit参数

(String) request.getParameter("submit");

<input type="submit" name="submit" value="保存">
第4个回答  2008-08-20
<!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 language="javascript">
function change1(){
window.location.href="xxxxx";<!-- 你要链接的地址-->

}
function change2(){
window.location.href="xxxxx";<!-- 你要链接的地址-->

}
</script>
</head>

<body>
<input type="button" onclick="change1()" value="发送简历"/><br /><br />
<input type="button" onclick="change2()" value="收藏工作"/>
</body>
</html>
第5个回答  2008-08-20
可以使用struts中的action来做。使用LookUpAction可以一个action控制多个按钮。