I\'m trying to do is hiding/showing a certain input object if a select value is checked.
Code in JSFiddle
The HTML part of the code is here:
<
I typically factor out the hide/show logic:
function foobar(){
if($(this).val() == "Other"){
$("#add_fields_placeholderValue").show();
}
else{
$("#add_fields_placeholderValue").hide();
}
}
and call it when the page loads.
$(document).ready(function(){
foobar();
$("#add_fields_placeholder").change(function(){
foobar();
});
});
but i'd be curious to see what other folks usually do.