I have a form which is producing a lot of spam. I have made all inputs required and have attached a captcha. This has not had any affect.
I assume the bots are using form.submit()
as for some reason this bypasses all my required fields AND also bypasses my onsubmit="check(e)"
I cannot seem to grab this event .submit()
by any means. Does anyone know how to catch this event and make sure it is cancelled. I want the only way to submit the form is through clicking the submit button.
$("#myForm").submit(function(event) {
console.log("Handler for .submit() called.");
if (CaptchaInput.value == "") {
event.preventDefault();
}
});
My code that was supposed to catch a .submit()
call and prevent the form submission. This function is never triggered.
<form target="hidden_iframe"
onsubmit="if (CaptchaInput.value == '') { why += '- Please Enter CAPTCHA Code.\n'; alert(why); return false; };return checkform(this)" id="myForm">