alert message for dropdown | Community
Skip to main content
New Participant
October 27, 2023
Question

alert message for dropdown

  • October 27, 2023
  • 0 replies
  • 418 views

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);

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.