好象要这样写吧:
<body>
<form name = "form1">
<input type = "button" onclick = "doClick()">
</form>
</body>

解决方案 »

  1.   

    可以这样写一个函数:
    <html>
    <script>
    function submitForm(formName)
    {
    var obj = formName
    var loc = "action.asp?"
    with(obj)
    {
    for(i = 0; i < elements.length; i++)
        {
    if(elements[i].value != "submit") 
    loc = loc + elements[i].id + "=" + elements[i].value + "&"
    }
    loc = loc.substr(0, loc.length-1)
    alert(loc)
        window.location = loc
    }
    }
    </script>
    <body>
    <img src="xbm.asp">
    <form name="frm">
    <input type="text" value="hello!" name="text1" ID="Text1"> 
    <input type="text" value="hello!" name="text1" ID="Text2"> 
    <input type="text" value="hello!" name="text1" ID="Text3"> 
    <input type="button" value="submit" onclick="submitForm(frm)">
    </form>
    </body>
    </html>action.asp为要提交到的页
      

  2.   

    <form id="form1">
    <input type = "button" onclick = "document.all.form1.submit()">
    </form>
    要用id不能用name