Expand my Community achievements bar.

alert message for dropdown

Avatar

Level 4

i have two dropdown if  dropdown value2 =width & value1=height then  in second dropdown the alert message will showing and dialog wont close, as per below code
now if i change in first dropdown value not equal height but still alert message is showing  but dialog is able to close
Now how i can remove that alert message

 

(function($, Coral) {
"use strict";

 

var registry = $(window).adaptTo("foundation-registry");

 


registry.register("foundation.validation.validator", {
selector: "[data-validation=field-validation]",
validate: function(element) {
let el = $(element);
let pattern=/[0-9a-z]/;
let value1=el.val();
var value2 = $("coral-select[name='./fields']");


if (($(value2).val() === 'width')){

 

if(value1 === "height"){
return "Chosen copy block width" ;
}
}

}
});


})(jQuery, Coral);

0 Replies