I'm trying to bind an submit event to a button that can't be type="submit" needs to be type="button"
I'm trying these to make the required attr validation works
So, can you say what I'm doing wrong here? I'm Googling a lot but didn't find anything yet.
Brian Tompsett - 汤莱恩
5,92772 gold badges64 silver badges135 bronze badges
asked Apr 15, 2016 at 13:35
Wagner Moreira
1,0981 gold badge17 silver badges43 bronze badges
1 Answer 1
With this code, you can trigger the submit event :
submitBtn.addEventListener('click', function () {
form.dispatchEvent(submitEvent);
});
However the HTML5 form validation won't work because it requires an actual submit button.
answered Apr 15, 2016 at 13:47
bviale
5,3933 gold badges30 silver badges48 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-js