JavaScript code to stop form submission

前端 未结 12 2051
感情败类
感情败类 2020-11-21 06:40

One way to stop form submission is to return false from your JavaScript function.

When the submit button is clicked, a validation function is called. I have a case i

12条回答
  •  隐瞒了意图╮
    2020-11-21 07:08

    Lets say you have a form similar to this

    Here is the javascript for the confirmAction function

    
    

    This one works on Firefox, Chrome, Internet Explorer(edge), Safari, etc.

    If that is not the case let me know

提交回复
热议问题