iteye_12339 2008-11-22 01:29
浏览 1110
已采纳

如何更改Form的method属性

[code="js"] if(method=="GET"){alert("GET");document.getElementById("myForm").method="GET";}
else if(method=="POST"){alert("POST");document.getElementById("myForm").method="POST";}[/code]

我的一个FORM的id是myForm,我是否有办法用js更改myForm的method属性?

  • 写回答

2条回答 默认 最新

  • sephy 2008-11-24 11:37
    关注

    form.method [ =sMethod ]
    sMethod String that specifies one of the following values:
    get Append the arguments to the action URL and open it as if it were an anchor.
    post Send the data through an HTTP post transaction.

    The property is read/write with no default value.

    可读写的,get/post

    倒是enctype那个比较搞,html是enctype,js里是encoding

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?