Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelminter/961835 to your computer and use it in GitHub Desktop.
Save michaelminter/961835 to your computer and use it in GitHub Desktop.
JQuery Event Change based on select drop-down
var events = [];
events[0] = ["Display content notification box 1"];
events[1] = ["Display content notification box 2"];
events[2] = ["Display content notification box 3"];
function updateEventDescription(){
for(var i = 0; i < events.length; i++){
if($('#prospect_event option:selected').val() == events[i][0]){
$("#event_description").html(events[i][1]);
i = events.length;
}else{
$("#event_description").html("<span class='no_event'>Please select an option from above.</span>");
}
}
}
$(function(){
$("#prospect_event").change(function(){
updateEventDescription();
});
updateEventDescription();
});
@anjanachaudhary
Copy link

qsw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment