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
onsubmit
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.
flag = true
flag = false