Please fill all fields with your correct details. you can only
register for a program once.
$(document).ready(function () {
$('#myModal').modal('show');
// Event listener for the event dropdown
$('#id_event').change(function() {
var selectedEvent = $(this).find('option:selected');
var capacityLeft = selectedEvent.data('capacity'); // Fix here
var eventName = selectedEvent.data('name');
if (capacityLeft !== undefined) {
alert('Total number of capacity left for ' + eventName + ' is (' + capacityLeft + ')');
}
});
});