Hello-
I'm trying to apply conditional formatting to a drop-down box in a Submission Form DataPage. For example, when the user selects "Fail" from the drop-down box, I want the background of the box to turn red.
Here's the code I tried to use without success. I pasted this into an HTML block directly after the drop-down box.
<script>
var select = document.getElementById("InsertRecordPrint_Asmt_Rec");
select.onchange = function(){
var selectedString = select.options[select.selectedIndex].value;
if (selectedString == "Fail") {
document.getElementById("InsertRecordPrint_Asmt_Rec").style.color = "red";
}
Else {
document.getElementById("InsertRecordPrint_Asmt_Rec).style.color = "black";
}}
</script>
Any help would be greatly appreciated.