Submit HTML form, perform javascript function (alert then redirect)

后端 未结 3 904
感情败类
感情败类 2021-02-01 05:58

I have a JavaScript function that works great when I call it through an \'onClick\' method. Basically what it does is pull data from a html form, and then based on that data, re

3条回答
  •  广开言路
    2021-02-01 06:22

    You need to prevent the default behaviour. You can either use e.preventDefault() or return false; In this case, the best thing is, you can use return false; here:

提交回复
热议问题