I am hoping someone can help.
I am trying to get a the correct pop-up message depending on a users input.
If the user is a 'Con Owner' they must fill out all items labelled as 'Con'. If they do not, they should have a warning message when they click submit.
I have written the below to loop through each item and where the owner of that item is equal to Con and the Value is empty it should give me the warning message. If they have filled it in, it should be the confirmation message.
However, the below isn't giving me the results I require. Irrespective of what happens, I always get the warning message as a pop up, even if the value has been populated.
Can anyone advise?
isValuePopulated() {
let attrData = this.attributes.attrData;
let isAttributeCompleted = true;
attrData.forEach(item=>{
if(item.owner==='Con' && commonFunctions.isEmptyString(item.value)){
isAttributeCompleted = false;
}}
);
if (isAttributeCompleted){
this.showErrorInfoPopUp('All correct!!!!', 'Confirmation', true);
} else {
this.setErrorPopUpButtonStatus(true, false, true);
this.showErrorInfoPopUp('Are you sure you want to continue?', 'Warning', true);
}
}
Aucun commentaire:
Enregistrer un commentaire