I am submitting my form by using JavaScript .submit() function.
form.submit();
But when I using addEventListener to capture my submit event, it wouldn't work.
form.addEventListener("submit", function(event){
//codes
});
I found out addEvenetListener function will only listen for onsubmit event instead of submit. Is there have any alternative solution to call my function when form.submit() is executed?
ps: For some reasons I need to stay with form.submit() to submit my form instead of using submit button.