我的网站上有查询表。垃圾邮件发送者正在使用它继续向我发送SEO和约会链接。我想停止这个。在提交表单之前,他们必须在公司名称字段中输入“ google”。
是否有一种简单的方法可以将这些垃圾邮件发送到提交的我的“谢谢”页面上,因此他们认为他们已成功向我发送了垃圾邮件,但实际上没有任何反应?
基本上-如果提交的公司名称字段= google,那么提交时不通过电子邮件发送表单结果,而仅显示thankyou.html页面。
我的页面在这里here is my contact form
评论部分中的跟进。
在您的formCheck()
函数内部,替换这段代码
if (alertMsg.length == l_Msg){
return true;
}else{
alert(alertMsg);
return false;
}
with
if (alertMsg.length == l_Msg){ // No alerts
let companyName = formobj.elements['Company'].value || "";
if(companyName==='google'){ // Potential spam, redirect to "Thank you" page.
window.location.href='https://www.insight-software-training.co.uk/confirm.htm'
return false;
}
// Otherwise, proceed as valid entry.
return true;
}else{
alert(alertMsg);
return false;
}