function validate_login()
{
    $('.form-control').removeClass('is-invalid');
    $('.characters-invalid-feedback').addClass('d-none');

    var email = $('#email_id').val().trim();
    var password = $('#password').val().trim();

    if(email == '')
    {
        $('#email_id').addClass('is-invalid').focus();
        return false;
    }

    var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;

    if(!emailPattern.test(email))
    {
        $('#email_id').addClass('is-invalid').focus();
        return false;
    }

    if(password == '')
    {
        $('#password').addClass('is-invalid').focus();
        return false;
    }

    return true;
}

function validate_change_password()
{
	 $('.form-control').removeClass('is-invalid'); 
	 $('.password-invalid-feedback').addClass('d-none');
	 
	if($('#oldpassword').val()=='')
	{
		 $('#oldpassword').addClass('is-invalid').focus();
        return false;
	}
	if($('#newpassword').val()=='')
	{
		 $('#newpassword').addClass('is-invalid').focus();
        return false;
	}
	if($('#cnfpassword').val()=='')
	{
		 $('#cnfpassword').addClass('is-invalid').focus();
        return false;
	}
	if($('#cnfpassword').val()!=$('#newpassword').val())
	{
		 $('.password-invalid-feedback').removeClass('d-none');
        $('#cnfpassword').focus();
        return false;
	}
	return true;
}