[Forminator Pro] Forminator Pro Date Picker

In the forum I raised this topic https://premium.wpmudev.org/forums/topic/using-forminator-as-for-booking-request-form?replies=8#post-1375650
I have part solved my date selector issue but not completely.
I now have another issue: after selecting some dates as not being available, the booking requestor can overwrite that by physically entering the date. Can we have the date validated in format and against dates available? Or prevent physical input?

  • Ash

    Hello Geoff Trebilco

    Yes, I can confirm the issue on my test site, so I am marking this as a bug and reporting to the developer. Hopefully, very soon this will be resolved and an update will be released. We appreciate your patience on this.

    As a workaround for now, please edit the datepicket field, go to Styling tab, for "Additional CSS Classes" give a unique class name, for example, "my-date" in my case.

    Then try the following code:

    add_action( 'wp_head', function() {
    	?>
    	<script>
    		jQuery(function($){
    			var dtpckr = setInterval(function() {
    				if( $('.my-date input').length ) {
    					$('.my-date input').attr('readonly', 'readonly');
    					clearTimeout(dtpckr);
    				}
    			}, 500);
    		});
    	</script>
    	<?php
    } );

    If you use another class name, make sure you change it in the code as well.

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.