Form submit to run javascript and then post to php script

后端 未结 4 1952
暗喜
暗喜 2021-01-13 11:13

I am currently working on a php/html/javascript project. I have a form where when the user presses the submit button, it should run a javascript function and then afterwards

4条回答
  •  北恋
    北恋 (楼主)
    2021-01-13 12:07

    Replace the action attribute with the name of your PHP page, and have the validateAddImage method as an onsubmit event.

提交回复
热议问题