In the following code, added to the on add -> validate block of the Script tab, the Booking_Form restricts entries based on the following conditions:
if (count(Booking_form[(Place == input.Place && TripDate == input.TripDate)]) == 4)
{
alert "Booking full on this date. Please try some other date";
cancel submit;
}
else if (input.Date_1.getDayOfWeek() >= 6)
{
previous_weekend1 = (input.TripDate - '1W:0D:0H:0M:0S');
previous_weekend2 = (input.TripDate - '0W:6D:0H:0M:0S');
if ((count(Booking_form[(Name == input.Name && TripDate == previous_weekend1)]) != 0) ||
(count(Booking_form[(Name == input.Name && TripDate == previous_weekend2)]) != 0)) {
alert "You cannot book consecutive weekends";
cancel submit;
}
}