Betiok
8/3/2017 - 5:21 PM

Chosen Select Field

Chosen Select Field

/* Select Fields */

$('.wpcf7-select').chosen({
  disable_search_threshold: 10,
  inherit_select_classes: true
});

$('.wpcf7-select').on('change', function () {
	$('.chosen-container-single').addClass('active');
});

document.addEventListener('wpcf7mailsent', function(event) {
	$('.wpcf7-select').val('').trigger('chosen:updated');
	$('.chosen-container-single').removeClass('active');
}, false );
wp_register_script('chosen', get_template_directory_uri() . '/js/chosen.jquery.min.js', array('jquery'), '1.6.2');
wp_enqueue_script('chosen');

wp_register_style('chosencss', get_template_directory_uri() . '/css/chosen.css', array(), '1.6.2', 'all');
wp_enqueue_style('chosencss');
!_COOMON -> chosen js