I've got show/hide working great depending on the value chosen from a select
$( document ).ready( function () {
$("#fac_name").change(function() {
var value = this.value;
if (value == "other") {
$("#otherFAC").show( "slow" );
} else {
$("#otherFAC").hide( "slow" );
}
} );
} );
Where I'm having my problem - the value can also be set coming directly from the database...
<?php
if ( $p['foo'] == 'foo' ) {
echo 'selected="selected"';
}
?>
I'm missing whatever I need to get the value when the document loads and go ahead and set the show/hide ...
I've got this working for all my radio buttons by adding:
$( '[name="travel_comp_num"]:checked' ).trigger( 'click' );
.... but I can't seem to get this to translate to my selects. Need a little assistance please...