What happens if the action field in a <form> has parameters?

前端 未结 4 1714
予麋鹿
予麋鹿 2020-12-01 10:14

Is there a well-supported, common behavior that I can expect if I do something like this in HTML:

4条回答
  •  爱一瞬间的悲伤
    2020-12-01 10:51

    If the method attribute is set to GET, the browser drops the querystring parameters from the action attribute before constructing the form argument values.

    So in your example, the request to the server on submit will look like: /somePage.html?param2=value¶m3=value

    So no, when the method is "GET", as in your example, there's no reason to do this.

提交回复
热议问题