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";
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
apatrick
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.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.