Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created September 8, 2020 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/f95fb92fa3573af030e141ab2afed82a to your computer and use it in GitHub Desktop.
Save Pebblo/f95fb92fa3573af030e141ab2afed82a to your computer and use it in GitHub Desktop.
Example of how you can set EE datepicker questions to be readonly which means users must use the datepicker and not type in values manually
<?php // Please do not include the opening PHP tag if you alreayd have one
// Example of how you can set EE datepicker questions to be readonly
// which means users must use the datepicker and not type in values manually.
add_action( 'wp_enqueue_scripts', 'tw_ee_datepicker_readonly', 11 );
function tw_ee_datepicker_readonly() {
wp_add_inline_script(
'single_page_checkout',
'jQuery(document).ready(function($){
$(".ee-datepicker-input-dv input").prop("readonly", true);
});'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment