Try this.
<aura:component implements="force:appHostable" controller="LightingDmlOperation">
<div class="container-fluid">
<div class="slds-form-element">
<div class="slds-form-element__control" style=" margin-left: 60px;width:25%">
<ui:inputText aura:id="AccountName" label=" Name" class="slds-input" labelClass="slds-form-element__label" value="{!v.newAccount.Name}"
placeholder="Enter Name" required="true" onError="{!c.handleError}" onClearErrors="{!c.handleClearError}" />
</div>
</div>
<div class="form-group" style=" margin-left: 60px;width:25%">
<ui:inputText aura:id="Accounttype" label="Type" class="slds-input" labelClass="slds-form-element__label"
value="{!v.newAccount.Type}" placeholder="Enter type value" onClearErrors="{!c.handleClearError}"/>
</div>
<div class="form-group" style=" margin-left: 60px;width:25%">
<ui:inputText aura:id="AccountPhone" label=" Phone" class="slds-input" labelClass="slds-form-element__label"
value="{!v.newAccount.Phone}" onError="{!c.handleError}" onClearErrors="{!c.handleClearError}" />
</div>
<div class="col-md-4 text-center" style=" margin-left: 120px;width:25%" algin="center">
<ui:button label="Submit" class="slds-button slds-button--neutral" labelClass="label" press="{!c.createAccount}" />
</div>
</div>
</aura:component>
Controller
({
createAccount : function(component, event, helper) {
var nameField = component.find("AccountName");
var nameValue = nameField.get("v.value");
var PhoneField = component.find("AccountPhone");
var nameValue1 = PhoneField.get("v.value");
var newAcc = component.get("v.newAccount");
var action = component.get("c.saveAccount");
action.setParams({ "acc": newAcc});
action.setCallback(this, function(a) {
var state = a.getState();
if (state === "SUCCESS") {
var name = a.getReturnValue();
}
});
$A.enqueueAction(action);
if(nameValue.length <0 ||nameValue.length==0 ) {
nameField.set("v.errors", [{message:"Name value can not blank"}]);
}
else if (($A.util.isEmpty(nameValue1) || $A.util.isUndefined(nameValue1))){
PhoneField.set("v.errors",[{message:"phone can not null"}]);
}
else {
nameField.set("v.errors",null);
PhoneField.set("v.errors",null);
}
},
handleError:function(cmp,event,helper){
var comp = event.getSource();
$A.util.addClass(cmp, "error");
},
handleClearError:function(cmp,event,helper){
var comp = event.getSource();
$A.util.removeClass(cmp, "error");
},
})