Hi, I'm new to Scripting so this may be way off base.
I have a Form where a Drop Down selection that is used to trigger a Lookup to populate the fields of a Table from a Database.
The Table is basically a Checklist with the following Fields
Radio Button (Applicable), Task Desc, Radio Button (Completed), Notes.
The Radio Buttons can have the values of "Yes" or "No".
The Table has a Class of RadioTable, and the 2 Radio Fields have the class or
RadioAppl and RadioCmp.
I wrote the following Script to change the Color of the line in the Table row based on the radio selections which does work when the Radio Buttons are "clicked". The color of the row chnages to Grey if Applicable (No) is Clicked and to Green if Completed (Yes) is Clicked. If the opposite values are Clicked the Rows are set to White
$(document).ready(function () {
$('.RadioTable').on('change',".RadioAppl input:checked", function() {
if ($(this).val() == "No"){
$(this).closest('tr').css("background-color", "#cccccc");
}else{
$(this).closest('tr').css("background-color", "#ffffff");
}
});
});
$(document).ready(function () {
$('.RadioTable').on('change',".RadioCmp input:checked", function() {
if ($(this).val() == "Yes"){
$(this).closest('tr').css("background-color", "#adffef");
}else{
$(this).closest('tr').css("background-color", "#ffffff");
}
});
});
What I am finding is that once the Form has been submitted is that the Row Color does not stay with the Form when I review the form in the Task Inbox. So I'm thinking that I need a Script that evaluates the form each time it is opened to assign the row colors based on the current Radio Button settings but I cannot figure out how to trigger that.
I tried this but no go
$(document).ready(function () {
AddColor();
function AddColor() {
$('.RadioTable').ready,".RadioAppl input:checked", function() {
if ($(this).val() == "No"){
$(this).closest('tr').css("background-color", "#cccccc");
}else{
$(this).closest('tr').css("background-color", "#ffffff");
}
}
});
});
I also realize the coding above is likely not structured properly as I find it had to keep track of all the brackets required :) so any Help is Appreciated.
Thanks