Hey guys,

Is there a way I can tell a date field in a webform to allow only weekdays, NOT weekends?

Thanks,

Comments

quicksketch’s picture

Title: Date field question » Allow only certain days of the week (i.e. weekdays or weekends)

Unfortunately there's no built-in way to do this in Webform (3.x or 4.x). You can only set min and max dates, which could allow you to use dates like "monday" as the min and "friday" as the max, but that wouldn't work for anything beyond the current week. This might be a good new option for the module, but it would only be added to the 4.x version of the project.

However if you have a more sophisticated requirement, such as some kind of calendaring system, you might be better off just writing custom validation on your form. There's a handbook page for this sort of thing at https://drupal.org/node/1291574.

quicksketch’s picture

Status: Active » Closed (fixed)

Closing after lack of activity.