Hi, I have created a form using Room Booking Forms for BF. During past months I often receive spam messages through the form. What I noticed was that in 2 fields (calendar for arrival and departure dates) the dates were from the past (1976 - 12-11).
So I added in validation (custom) this for check in date
function ff_checkindate_validation(element, message)
{
if(element.value.split("-").length != 3){return message == '' ? element.name+" faild in my test.n" : message}
var vDate = new Date(Number( element.value.split("-")[0]),Number(element.value.split("-")[1]-1),Number(element.value.split("-")[2]),0,0,0).getTime();
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
today = today.getTime();
if(vDate < today)
{
if (message=='') message = element.name+" faild in my test.n";
return message;
}
return '';
}
and this for check out date
function ff_checkoutdate_validation(element, message)
{
if(element.value.split("-").length != 3){return message == '' ? element.name+" faild in my test.n" : message}
var vDate = new Date(Number( element.value.split("-")[0]),Number(element.value.split("-")[1]-1),Number(element.value.split("-")[2]),0,0,0).getTime();
var today = new Date();
today.setHours(0);
today.setMinutes(0);
today.setSeconds(0);
today.setMilliseconds(0);
today = today.getTime();
if(vDate < today)
{
if (message=='') message = element.name+" faild in my test.n";
return message;
}
return '';
}
The problem is that I still receive spam messages with older dates, even though in my tests if I add past dates there I get an error message and cannot submit form.
In addition, there is an increase of spam in most forms I have in several websites. All forms have v3 recaptcha. Is this normal?
Thank you in advance.
Antonis