TOPIC:

How to exclude a day from calender / make it non-selectable 1 year 3 months ago #242283

  • Topic Author
  • ulfak
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 43
  • Thanks: 0
Hey!

I work with a customer who has a catering company. We have created a form where you can order catering from the website. The form has a calendar-field where you can choose which day and time you want the catering.

Now my customer is wondering if it is possible to make a specific day non-selectable. The reason for this is that sometimes he gets full booked and cannot receive more orders that day.

Is there any solution for this?

Please Log in or Create an account to join the conversation.

How to exclude a day from calender / make it non-selectable 1 year 3 months ago #242286

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6928
  • Karma: 3
  • Thanks: 494
Hi,

Go to your form Advanced->more options->Form pieces->Before form->Custom, and put this code for example:
echo '<script type="text/javascript">
                                        
    JQuery(document).ready(function () {
                             
        JQuery("#ff_elem1293_calendarButton").pickadate({
			format: "yyyy-dd-mm", 
                        selectMonths: true,
                        selectYears:100,
                        min: [2020,1,1], max:[2110,1,1],
                        disable:[[2020,5,7]],
			onSet: function() {JQuery("#ff_elem1293").val(this.get("value"));}
		});
        });
</script>'

Note: Please make sure to replace both instances of ff_elem1293 with the correct ID of responsive calendar element in your form.

Note 2: Here I disabled 7.6.2020. I put this 2020,5,7, because months are counted from 0 - 11. So for 7.6.2020. it will be [2020,5,7] not [2020,6,7].

Let me know if it is ok for you.

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Last edit: Post by tihana.krivic.

How to exclude a day from calender / make it non-selectable 1 year 3 months ago #242291

  • TheMuffinMan's Avatar
  • TheMuffinMan
  • Offline
  • Developer
  • Developer
  • Posts: 10064
  • Karma: 167
  • Thanks: 808
@ULFAK

you can determine the calendar id (the number) that Tihana is talking about if you right click on the element with the browser and hit "inspect".

Regards,
Markus

Please Log in or Create an account to join the conversation.

How to exclude a day from calender / make it non-selectable 1 year 3 months ago #242587

  • Topic Author
  • ulfak
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 43
  • Thanks: 0
Hi again and thanks for the suggestions

I have tried but did not manage to solve it. I have put the following code at custom but nothing happens. The date 17 of june is still selectable.
echo '<script type="text/javascript">
                                        
    JQuery(document).ready(function () {
                             
        JQuery("#ff_elem220").pickadate({
			format: "yyyy-dd-mm", 
                        selectMonths: true,
                        selectYears:100,
                        min: [2020,1,1], max:[2110,1,1],
                        disable:[[2020,5,17]],
			onSet: function() {JQuery("#ff_elem220").val(this.get("value"));}
		});
        });

Please Log in or Create an account to join the conversation.

How to exclude a day from calender / make it non-selectable 1 year 3 months ago #242588

  • Topic Author
  • ulfak
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 43
  • Thanks: 0
Im using the element type "Calender" not "Responsive calender" if it is any help

Please Log in or Create an account to join the conversation.

How to exclude a day from calender / make it non-selectable 1 year 3 months ago #242594

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 6928
  • Karma: 3
  • Thanks: 494
Hi,

this code works for "responsive calendar".
I will test it for the "calendar" so I will give you feedback.

Regards,
Tihana

Please Log in or Create an account to join the conversation.

Moderators: ForumSupport
Time to create page: 0.129 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

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!