jQuery(document).ready(function($){
$('#form-field-ref_form_course_name').change(function(){
alert('i am working');
// Hide all dropdowns initially
$('[id^=form-field-ref_form_course_]').hide();
// Get the selected option
var selectedOption = $(this).val();
// Show the corresponding dropdown based on the selected option
if(selectedOption === "Mastering the Art of Modern Management") {
$('#form-field-ref_form_course_1').show();
$('#form-field-ref_form_course_2').hide();
$('#form-field-ref_form_course_3').hide();
} else if(selectedOption === "Mastering the Art of Communication for Modern Leader") {
$('#form-field-ref_form_course_1').hide();
$('#form-field-ref_form_course_2').show();
$('#form-field-ref_form_course_3').hide();
} else if(selectedOption === "Championing Change Through Diversity & Inclusion") {
$('#form-field-ref_form_course_1').hide();
$('#form-field-ref_form_course_2').hide();
$('#form-field-ref_form_course_3').show();
} else {
$('[id^=form-field-ref_form_course_]').hide();
}
});
});