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
Dev87Dev87 

lightning- Alert Messages

Hello every one, 

I have to 3 lightning input numbers ( Percent) and I want to verifie if sum of all < 100%.
In this case, un alert msg msut be appear in the page and the submit blocked, 
Any help please
Ashif KhanAshif Khan
Hi Dev
 
var val1 =23;//your value 1
var val2 =20;//your value 2
var val3 = 40;//your value 3
var totalPcnt=parseInt(val1)+parseInt(val2)+parseInt(val3);
if(totalPcnt<100){
alert('total precentage is less than 100%');
return false;
}

I hope this will help you

Regards
Ashif