action表单转向 即提交表单 表单转向action指向的页面

解决方案 »

  1.   

    document.formname.action = '../../1.html';
      

  2.   

    简单点说,form表单中的action的作用是将表单中的内容提交到某个页面去执行.
    可以在当前页执行,也可以在其他页面去执行.
    简单的两个示例:
    一、index.asp(提交到1.asp去执行)
    <form name="form1" action="1.asp" method="post">
    姓名:<input type="text" name="aa" value="">
    <input type="submit" name="submit" value="提交">
    </form>
    在1.asp中读取从index.asp提交来的数据,如:
    你的姓名是:<%=request("aa")%>二、index.asp(在本页执行)
    <form name="form1" action="index.asp?submit=yes" method="post">
    姓名:<input type="text" name="aa" value="">
    <input type="submit" name="submit" value="提交">
    </form>
    在本页读取提交来的数据,如:
    <%
    if request.querystring("submit")="yes" then
    dim aa
    aa=request("aa")
    response.write("你的姓名是:"&aa)
    end if
    %>
      

  3.   

    submit的时候会自动触发form中已定义的action到对对应的操作方法(页面)如果需要脚本改变
    给form一个id form1
    document.getElementById("form1").action=