Set a form's action attribute when submitting?

后端 未结 7 1240
情话喂你
情话喂你 2020-12-03 00:45

How do I change a form\'s action attribute right after clicking the submit button?

7条回答
  •  执笔经年
    2020-12-03 01:25

    You can also set onSubmit attribute's value in form tag. You can set its value using Javascript.

    Something like this:

    Here is your entire form
    ;

    Remember that onSubmit has higher priority than action attribute. So whenever you specify onSubmit value, that operation will be performed first and then the form will move to action.

提交回复
热议问题