Select Default value in coral select field at AEM Page Properties 6.3
Hi All,
I am trying to set default dropdown value at page properties level where I need to first get the selected value and then change the default value based on current url. Below is the code snippet I tried so far:
$(document).ready(function() {
var currentUrl = window.location.href;
var hrefLang = "x-default";
if(currentUrl.indexOf('us/en') > -1){
hrefLang = "en-US";
}
$("#coral-id-105").each(function(index, value) {
$("#coral-id-105 coral-selectlist-item[value="+ hrefLang +"]").prop('selected', true);
});
});
I am getting undefined every time when I am trying to alert the current value.
Note: I don't need to add value from datasource. I have static values just need to set one as default.