如图:<a href="http//localhost/index.php?msg=内容">提交</a>
对应的 a中‘内容’代码怎么写?
文本域中的代码怎么写?
如果有懂的,请写个详细实例。非常感谢 

解决方案 »

  1.   

    <form action="index.php" method = "get" id="theforever"> 
    <input type=text name=msg />
    <a href="javascript:theforever_csdn();">提交</a>
    </form>
    <script>
    function theforever_csdn(){
      document.getElementById("theforever").submit();
    }
    <script>
      

  2.   

    <a href="javascript:;" onclick="Fun()">提交</a>
    function Fun(){window.location.href="http//localhost/index.php?msg="+document.getElementById("文本ID").value+"";}
      

  3.   

    测试这种方法后,发现提交后的地址会显示本地地址;如 “本地地址+"http//localhost/index.php?。”
    怎么去掉本地地址前缀
      

  4.   

    <html>
    <head>
    </head>
    <body>
    <form id=form1 style="display: none;" method=get action="http//localhost/index.php">
    <input type=hidden name=msg value="内容">
    </form>
    <input type=button value=提交 onclick=form1.submit()>
    </body>
    </html>