I have JavaScript that works in JSFiddle but not in LiveCycle Designer ES3. What I'm trying to do is have the field of a drop down list change background color when an option other than the default option is selected (on change).
function BackgroundChange(ddl) {
var value = ddl.srcElement.options[ddl.srcElement.selectedIndex].value;
var positionddlist = document.getElementById('positionddlist');
// 99 is the value assigned to the default option
if (value !== "99") {
alert('Changes from default values require comment.');
document.getElementById('positionddlist').style.backgroundColor = "orange";
} else {
document.getElementById('positionddlist').style.backgroundColor = "";
}
}
Suggestions?