BreezingForms

 

Here it is explained how to disable certain day(s) of the week in a Responsive Calendar, in other words, how to make it unclickable. Also, styling is added to the disabled day of the week so that users easier recognize that it can't be clicked on.

 

Go to Advanced options of your form > More options > Form pieces > Before Form, set Type to Custom and paste the following code:

echo '<script type="text/javascript">
		JQuery(document).ready(function () {
					
			JQuery("#ff_elem16229_calendarButton").pickadate({
				format: "yyyy-mm-dd", 
				selectYears: 60, 
				disable: [7],
				selectMonths: true,
				editable: true,
				firstDay: 1,
				onSet: function() {JQuery("#ff_elem16229").val(this.get("value"));}
			});
                    
		});
	</script>
<style>
.picker__day--disabled{
background-color: gray !important;
}
</style>
';

This is an example which will disable Sundays.

NOTE: You have to replace ff_elem5113_calendarButton with the ID of your calendar button. To find it you have to inspect that element. Also, replace ff_elem5113 with the right ID of the calendar field.

The part between <style> tags will make the disabled fields background gray. Here you can adjust CSS as you like.

Which days of the week are disabled is explained by the following:

disable: [6,7]

 

To disable the whole weekend, the following code should be added:

echo '<script type="text/javascript">
		JQuery(document).ready(function () {
					
			JQuery("#ff_elem16229_calendarButton").pickadate({
				format: "yyyy-mm-dd", 
				selectYears: 60, 
				disable: [6,7],
				selectMonths: true,
				editable: true,
				firstDay: 1,
				onSet: function() {JQuery("#ff_elem16229").val(this.get("value"));}
			});
                    
		});
	</script>
<style>
.picker__day--disabled{
background-color: gray !important;
}
</style>
';

 NOTE: Replace the ID as explained above.

 

 That will disable the wanted days which can be very useful, especially if the form is used for some kind of reservations or application.

 

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99 for just 49! (Summer Sale)

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Live Support Chat Opened!

Join our Discord chat here to receive live support and talk directly to the team!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here