jcadima
8/12/2015 - 9:41 PM

Make First Drop Down Value Disabled

Make First Drop Down Value Disabled

// ##################  WP   ###################
function theme_js() {

	// ********* LOAD IN FOOTER
	wp_enqueue_script ('theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery'),'', true  ) ;
}
add_action('wp_enqueue_scripts', 'theme_js') ;



// ################# HTML  #####################
<select id="forklift_make">
<option value="Forklift Make:">Forklift Make:</option>
<option value="Advance">Advance</option>
<option value="Allis Chambers">Allis Chambers</option>
</select>



// #################  CSS that fixes the opacity issue in WP ##############
select#forklift_make {
    opacity: 1 !important;
    height: 30px;
    border: 0;
}


//################   JAVASCRIPT (theme.js) ##################
jQuery.noConflict();

jQuery(document).ready(function(){

	jQuery("select option[value*='Forklift Make:']").prop('disabled',true);

});