onsubmit method doesn't stop submit

后端 未结 6 1087
生来不讨喜
生来不讨喜 2020-12-11 03:35

My onsubmit is not working. My idea was to put some mandatory fields and, in order to achieve that, I was using the onsubmit method inside a form i

6条回答
  •  执笔经年
    2020-12-11 03:44

    An object will always evaluate to true, even if it's a Boolean object with value false.

    Put flag = true at the top of the function, then flag = false instead of creating a Boolean.

提交回复
热议问题