In the code bellow, if I have the line hackButton.type='hidden', my form gets submitted (which is what I want), but I don’t want to hide the button. What is the alternative that I have? I can’t change it to ‘submit’ or ‘button’ since they don’t work.
var hackButton = document.loginform.submit_login;
hackButton.type='button';
var listener =
hackButton.addEventListener('click', function() {
//do things here before form submission
hackButton.type='hidden';
setTimeout("document.loginform.submit()", 3000);
}, true);
Try
setTimeout("document.loginform.submit", 3000);orsetTimeout(document.loginform.submit, 3000);or evensetTimeout(function() { document.loginform.submit() }, 3000);