$(document).ready(function(){
    
// HIDE LICENCE NO IF DIRECTOR IS NOT LINKED TO ANOTHER LICNCE
    // DEFAULT STATE
    $('#otherLicenceNo').attr('disabled', 'disabled');
	$('#otherLicenceNo').removeAttr('required');
	$('.anotherLicenceNo-div').hide();
	
	$('#currentLicenceNo').attr('disabled', 'disabled');
	$('#currentLicenceNo').removeAttr('required');
	$('.currentLicenceNo-div').hide();
}); 

$('.otherLicence').change(function(){
    	var otherLicence = $('.otherLicence').val();
    	if (otherLicence == "Yes") {
    		$('.anotherLicenceNo-div').show();
    		$('#otherLicenceNo').removeAttr('disabled');
    		$('#otherLicenceNo').attr('required', 'required');
    	}else{
    		$('#otherLicenceNo').attr('disabled', 'disabled');
    		$('#otherLicenceNo').removeAttr('required');
    		$('.anotherLicenceNo-div').hide();
    	}
});


$('#applicationType').change(function(){
    	var applicationType = $('#applicationType').val();
    	if (applicationType == "Licence Renewal") {
    		$('.currentLicenceNo-div').show();
    		$('#currentLicenceNo').removeAttr('disabled');
    		$('#currentLicenceNo').attr('required', 'required');
    	}else{
    		$('#currentLicenceNo').attr('disabled', 'disabled');
    		$('#currentLicenceNo').removeAttr('required');
    		$('.currentLicenceNo-div').hide();
    	}
});

$('.changeEmpEmail').click(function() {
    var employeeId = $(this).attr('data-employeeId'); 
    // Set the value of the input field
    $('#employeeId').val(employeeId);
});
