Hi friends,
I am having one radio button list.
I am using three check boxes. If i click first radio button list item, the first check box need to show. In the same scenario for another two radio button list items and checkboxes. How can we done in javascript. i call it the onclick function and put it node value for this condition but when in alert the node value is giving null. this is my java script code.Code:<asp:RadioButtonList ID="rdHealthCleared" runat="server" CssClass="radiobtn" AutoPostBack="true" OnClick="showRadioCheckBox()" CausesValidation="false" CellPadding="0" CellSpacing="0" Width="275px"> <asp:ListItem id="rdNotCleared" runat="server" Text="Not Cleared" Value="1"/> <asp:ListItem id="rdPending" runat="server" Text="Pending further Info from Applicant" Value="2"/> <asp:ListItem id="rdCleared" runat="server" Text="Cleared" Value="3" /> </asp:RadioButtonList>
It is very urgent. Hope your's reply.Code:var uxNotClearedObj = document.getElementById('uxOHCNotCleared2'); //alert(uxNotClearedObj); var uxPendingObj = document.getElementById('uxOHCPending2'); // alert(uxPendingObj); var uxClearedObj =document.getElementById('uxOHCCleared2'); //alert(uxClearedObj); var rdPendingObj = document.getElementById('rdPending'); // alert(rdPendingObj); var rdClearedObj = document.getElementById('rdCleared'); var rdNotClearedObj = document.getElementById('rdNotCleared'); // alert(rdClearedObj); var rdHealthClearedObj = document.getElementById('rdHealthCleared'); //alert(rdHealthClearedObj); if(rdHealthClearedObj.nodeValue = "1") { alert("first radio" + rdHealthClearedObj.nodeValue); uxNotClearedObj.style.display = 'block'; if(uxNotClearedObj.checked) TdNotCleared.style.display = 'block'; else TdNotCleared.style.display = 'none'; uxPendingObj.style.display = 'none'; uxClearedObj.style.display = 'none'; TdPendingDate.style.display = 'none'; TdCleared.style.display = 'none'; } else if(rdPendingObj.nodeValue = "2") { alert("second radio"); uxPendingObj.style.display = 'block'; alert("display done"); if(uxPendingObj.checked) TdPendingDate.style.display = 'block'; else TdPendingDate.style.display = 'none'; uxNotClearedObj.style.display = 'none'; uxClearedObj.style.display = 'none'; TdNotCleared.style.display = 'none'; TdCleared.style.display = 'none'; } else if(rdClearedObj.nodeValue = "3") { alert("third radio"); uxClearedObj.style.display = 'block'; if(uxClearedObj.checked) TdCleared.style.display = 'block'; else TdCleared.style.display = 'none'; uxNotClearedObj.style.display = 'none'; uxPendingObj.style.display = 'none'; TdNotCleared.style.display = 'none'; TdPendingDate.style.display = 'none'; }
Thanks





Reply With Quote