通过脚本来检测用户的选择分支,从而向不同的程序提交表单,看看样例: 样例20:分支提交 
用户名:  密码:
公司用户  个人用户    分析:这里首先用到的是form的onSubmit="TwoSubmit(this)"
然后根据选择的分支,来分别递交到不同的程序,TwoSubmit()函数如下:<script>
function TwoSubmit(form){
if (form.Ref[0].checked){
form.action = "cop.asp";//这里是分支一
}else{
form.action = "ind.asp";//这里是分支二
}
form.submit();
}
</script> 

解决方案 »

  1.   

    try something like this:<form name="frmtest" method="post">
    <input name="teee">
    <input type=submit value="删除" onclick="DeleteThing()">
    <input type=submit value="打印" onclick="PrintThing()">
    </form><script language="javascript">
    function DeleteThing()
    {
      document.frmtest.action="deletefile.asp";
      document.frmtest.target="delete";
    }
    function PrintThing()
    {
      document.frmtest.action="printfile.asp";
      document.frmtest.target="print";
    }
    </script>
      

  2.   

    document.frmtest.target="print"和document.frmtest.target="delete";有什么用处呢?
      

  3.   

    that is just an example, they submit the form to two separate windows, one named "print", the other "delete"
      

  4.   

    使用form.action<form name="formname" action="">
    <input name="inputname">
    <input type="submit" onclick="document.formname.action='a.asp'" value="button a">
    <input type="submit" onclick="document.formname.action='b.asp'" value="button b">
    <input type="submit" onclick="document.formname.action='c.asp'" value="button c">
    </form> 
    或者:<input type=button name="a" value="a" onclick="this.form.action='a.asp';this.form.submit();">
    <input type=button name="b" value="b" onclick="this.form.action='b.asp';this.form.submit();">
    <input type=button name="c" value="c" onclick="this.form.action='c.asp';this.form.submit();">
    <input type=button name="d" value="d" onclick="this.form.action='d.asp';this.form.submit();">