Support

Account

Home Forums General Issues Select dates to disable in frontend datepicker

Solved

Select dates to disable in frontend datepicker

  • Hello!

    My goal is to create a simple backend option to disable date selection. So i could disable few dates from the backend. And in front it cant be selected or it displays some error text.

    Ideally, id like to combine it with CF7 form datepicker.

    I have done some research, i can disable them manually but how can i combine ACF and datepicker from CF7?

  • How do you disable the dates manually? Is this done through filter/hook or do you have to somehow enter them into the field tag is CF7?

  • I mean, in theory, i should be able to enter number manually that will be disabled in front-end. This means combining js function with acf fields. Is this doable?

  • I am not familiar enough with that CF7 add on to know if it is possible or not.

    In theory… you could create an options page with a field, possibly a repeater, to add dates to. You could then get this list of dates and use this list to disable these dates from being chosen.

    You can use the WP functionality for localizing a script to have the list of dates added for your script to use. https://codex.wordpress.org/Function_Reference/wp_localize_script

    This would be entirely dependent on whether or not it’s possible in that add on

  • Yes, exactly that is my goal. But how can i “inject” values from custom field(php) to javascript?

    I can disable dates manually by editing datepicker script, but the problems is to getting it work with dynamic editing.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Select dates to disable in frontend datepicker’ is closed to new replies.