Expand my Community achievements bar.

Take 10 minutes to complete an Adobe Target review on Gartner Peer Insights, and as a thank you for your time, you’ll have the option to receive a $25 gift card!

alert message for dropdown

Avatar

Level 3

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