asp.net radiobuttonlist javascript
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: asp.net radiobuttonlist javascript

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Posts
    12

    asp.net radiobuttonlist javascript

    I've got an asp.net page and won't be able to use the update panel for asynchronous updates. I'm trying to figure out how to have a selection of a radiobuttonlist change the selected item in another radiobuttonlist. When rendered, the named elements are actually tables, with individual radiobuttons for each list item. Anybody got an idea how I can do this?


    Code:
           <script language="javascript"  type="text/javascript">
                // For changing sessions
                function getSessions() {
                    var CHK = document.getElementByName('radF');
                    var checkbox = CHK.getElementsByTagName('input');
                    var CHK2 = document.getElementByName('radP');
                    var checkbox2 = CHK2.getElementByTagName('input');
    
                    for (var i = 0; i < checkbox.length; i++) {
                        if (checkbox[i].checked) {
                            if (checkbox[i].value = 'three') {
                                for (var2 = j = 0; j < checkbox2.length; i++) {
                                    if (j = 2) {
                                        checkbox2.selectedIndex = j
                                    }
                                }
                            }
                        }
                    }
                }
            </script>
    </head>
    <body>
        <form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                        <asp:RadioButtonList id="radP" name="radP" runat="server"  >
                        <asp:ListItem Text="0" Value="0" Selected="true" />
                        <asp:ListItem Text="1" Value="1" />
                        <asp:ListItem Text="2" Value="2" />
                        </asp:RadioButtonList><br />
                        <asp:RadioButtonList id="radF" name="radF" runat="server" onClick="javascript:getSessions(this.form);" >
                        <asp:ListItem Text="0" value="0" Selected="True" />
                        <asp:ListItem Text="1" Value="1" />
                        <asp:ListItem Text="2" VaLUE="2" />
                        <asp:ListItem Text="3" VALUE="3" />
                        </asp:RadioButtonList><br />
    Last edited by PeejAvery; February 28th, 2011 at 03:52 PM. Reason: Added code tags

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center