Make Field Required if Another Field is Completed

I'm trying to make a field required if another field has been filled in, but my code is not working.. Is my approach right?

fd.spRendered(function() {
//Notes on change field required on Edit forms
fd.field('CompletionDate').$on('change', function(options) {
if((fd.field('CompletionDate')=null) {
fd.field('TotalCharged').required = false;
} else {
fd.field('TotalCharged').required = true;
}
});
});

Hello @Jeremy_Springer,

The condition is invalid. Please see the updated code:

fd.spRendered(function() {
    //Notes on change field required on Edit forms
    fd.field('CompletionDate').$on('change', function(options) {
        if((!fd.field('CompletionDate').value) {
            fd.field('TotalCharged').required = false;
        } else {
            fd.field('TotalCharged').required = true;
        }
    });
});