function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sam SwannSam Swann 

Accessing specific attribute from V.Value

Hi

I am new to Lightning Component development.
I have a method in my controller.js for validation check.
validateEmptyField : function(component) {
        var cmpValue = component.get("v.value");
        if ($A.util.isEmpty(cmpValue) || $A.util.isUndefined(cmpValue)){
            component.set("v.errors", [{message:"Field cannot be empty. Please enter valid data."}]);
            return false;
        }
        
        return true;
    }
I do have like 8 attributes for the v.value. 
How can I make 7 attributes to have this validation check and not for one field?

I need to extract that field from cmpValue, but I am not sure which default method to call.

Thanks