Search Results

Search found 1 results on 1 pages for 'user3614421'.

Page 1/1 | 1 

  • Radio button is not funtioning

    - by user3614421
    I'm having problem with my radio button in my gridview. I want to select any row one by one so that I can perform UPDATE, DELETE, and DISPLAY the row. When I select the button, the page will be refreshed and the button I selected before is not selected anymore. So I can't click any menu to update, delete or display the row. I noticed this is happening when I set the Autopostback = "True". How can I solve it? Any idea? Below are my codes: Page: <script language="javascript" type="text/javascript"> function radiobtn(id) { var rdBtn = document.getElementById(id); var List = document.getElementsByTagName("input"); for (i = 0; i < List.length; i++) { if (List[i].type == "radio" && List[i].id != rdBtn.id) { List[i].checked = false; } } } </script> <asp:RadioButton ID="CheckDel" runat="server" onclick="javascript:radiobtn(this.id)" OnCheckedChanged="CheckDel_CheckedChanged" AutoPostBack="True" /> server end: protected void CheckDel_CheckedChanged(object sender, EventArgs e) { CheckBox chkStatus = (CheckBox)sender; GridViewRow row = (GridViewRow)chkStatus.NamingContainer; Session["datestart"] = row.Cells[1].Text; Session["empid"] = row.Cells[2].Text; Session["empname"] = row.Cells[3].Text; Session["days"] = row.Cells[4].Text; Session["leavetype"] = row.Cells[5].Text; Session["leavestatus"] = row.Cells[6].Text; bool status = chkStatus.Checked; } Please help

    Read the article

1