Created
November 9, 2012 17:10
-
-
Save mrjasonweaver/4046901 to your computer and use it in GitHub Desktop.
Reveal Extra Fields OnChange Select with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.selectRevealChange = function(selector, val_text, reveal_container) { | |
// console.log(selector, val_text, reveal_container); | |
$(reveal_container).hide(); | |
$(selector).change(function () { | |
// console.log($(selector+" option:selected").val(), '===', val_text ); | |
if ($(selector+" option:selected").val() === val_text) { | |
$(reveal_container).slideDown('fast'); | |
} | |
}); | |
} | |
jQuery(document).ready(function($) { | |
App.selectRevealChange('#selector-name', 'value of option item', '#reveal-container'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment