Results 1 to 3 of 3

Thread: [RESOLVED] radio button list item using javascript in asp.net

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2007
    Posts
    241

    Resolved [RESOLVED] radio button list item using javascript in asp.net

    Hi friends,

    I am having one radio button list.
    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>
    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:
    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';
              }
    It is very urgent. Hope your's reply.
    Thanks
    Last edited by Guvera; Oct 27th, 2010 at 04:05 AM.
    Failing to plan is Planning to fail

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width