You need to sign in to do that
Don't have an account?
Shruti Nigam
how to stop execution in lightning component?
Hi all,
in my lightning controller i want to stop execution after displaying error.
but right now after displaying error it moves further.
Anyone know how to stop execution
In below code i am comparing two dates
Thanks in advance.
in my lightning controller i want to stop execution after displaying error.
but right now after displaying error it moves further.
Anyone know how to stop execution
In below code i am comparing two dates
var fromCmp = component.find("From_date"); var fromCmpval = fromCmp.get("v.value"); var toCmp = component.find("To_date"); var toCmpval=toCmp.get("v.value"); if (fromCmpval > toCmpval) { toCmp.set("v.errors", [{message:"To Date should be Less then To Date"}]); //here i want to stop execution after displaying error }
Thanks in advance.
You just need to add a line after error message:
return false;
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi