When I click in one of the table cells, radio buttons appear. I have to select a radio button and **click on the table cell** in order to change the text and background color of the cell. What I want is to change this immediately once i choose a radio button. I don't want to click on the table cell in order to display the value and background color.
Below is sample code:
- function deselect(index, name) {
- var app = "#app"+index;
- var radioGroupName = name+'rOptions';
- $("#app"+index).removeClass("selected");
-
- if ($('input[name='+radioGroupName+']:radio:checked').val() == 0)
- {
- $("#app"+index).get(0).innerHTML = $(app).attr('name');
- $("#app"+index).css("background-color", 'white');
- $("#app"+index).css("color", 'blue');
- document.getElementById("SID"+index).value = "0";
- }
- else if ($('input[name='+radioGroupName+']:radio:checked').val() > 0)
- {
- $("#app"+index).get(0).innerHTML = $(app).attr('name') + " " + $('input[name='+radioGroupName+']:radio:checked').attr('title');
- $("#app"+index).css("background-color", 'cyan');
- $("#app"+index).css("color", 'white');
- document.getElementById("SID"+index).value = $('input[name='+radioGroupName+']:radio:checked').val();
- }
- }
Thanks.