This only started happening today. When I make a selection from my dropdown, the value is always empty. Not undefined or anything. I can console log the array of options but if I select something it’s like it doesn’t exist. My goal is to validate if a selection is made or not. This was working but now, without a value, I’m stuck. I do not define my options with code, only validate.
export function lostfound_change(event) {
lostfound.validity.valid = true;
lostfound.resetValidityIndication();
console.log("reset validity and current selected index is " + lostfound.value)
}
This is called in my submit button code
export function lostAndFoundCheck (event) {
if (lostfound.value === "" || lostfound.value === undefined) {
lostfound.validity.valid = false;
lostfound.updateValidityIndication();
lostfound.selectedIndex = undefined;
lostfound.scrollTo();
console.log("lost found value error " + lostfound.value)
console.log(lostfound.options)
return false;
}else{
lostfound.validity.valid = true;
lostfound.updateValidityIndication()
console.log("lost found value success" + lostfound.value)
return true;
}
}