<body onload="document.forms[0].text.focus()">
<form>
<input name=text>
</form>

解决方案 »

  1.   

    得用多框架页面
    input操作是一个frame
    submit在另一个隐含frame里,通过隐含的form提交
      

  2.   

    <script>
    function test()
    {
    document.f.submit()
    document.f.txt.value=""
    }
    </script>
    <body onload='document.f.txt.value="";document.f.txt.focus()'>
    <form name=f method="POST">
    <input name=txt>
    <input type=button onclick="test()" value=submit>
    </form>
      

  3.   

    聊天室的做法一般是用一个隐藏的input,如下
    <script>
    function check(theForm){
    with(theForm){
    //这里做些验证
    msg.value=txt.value
    txt.value="";
    alert("清空了?");
    return true;
    }
    }
    </script>
    <form action="about:ok" method="POST" onsubmit="return check(this)">
    <input name=txt><input name=msg type=hidden>
    <input type=submit value=submit>
    </form>