liuswi
方法一:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>

<form action="" name="form1">
    <input type="button" value="查询1" type="submit" onclick="form1.action=\'action_1\';form1.submit();"/>
    <input type="button" value="查询2" type="submit" onclick="form1.action=\'action_2\';form1.submit();" />
</form>

或:
<Script Language="JavaScript">
    function modify()
    {
    document.form1.action="modify.jsp";
    document.form1.submit();
    } 

    function delete()
    {
    document.form1.action="delete.jsp";
    document.form1.submit();
    }
</Script>

<form name="form1" action="">
    <INPUT Type="Button" Name="Modify" Value="修改" onClick="modify()">
    <INPUT Type="Button" Name="Delete" Value="删除" onClick="delete()">
</form>
这样可以实现将多个按钮发送到不同的网页中。
</body>
</html>

方法二:
提交form的时候,里面的action不能带参数,例:
<form action="test.do?args=888"> 
   <input type="button" value="submit">
</form>

通过这个方法,test.do无法读取args,必须换成以下写法
<form action="test.do"> 
   <input type="hidden" name="args" value="888">
   <input type="button" value="submit">
</form>

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-12-10
  • 2021-11-18
  • 2021-08-24
  • 2021-09-27
  • 2021-10-23
猜你喜欢
  • 2021-09-19
  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案