HTML, making a button submit data to another url?

后端 未结 4 1728
北恋
北恋 2020-12-20 12:21

The following is my HTML:

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-20 12:51

    I have the form and it POSTs to login.php but I want the button Make a new account post the same data to register.php.

    Is that possible?

    In HTML5 it is, using the formaction attribute on the submit button.

    But browser support is probably not so good yet. Could be resolved using a Polyfil that attaches click handlers to such buttons automatically and changes the action attribute of the form dynamically, though.

提交回复
热议问题