I have a checkbox inside a gridview like this
<asp:GridView ID="GridView1" runat="server" BorderColor="Blue" BorderWidth="1px" CellPadding="4" Font-Size="Small" ForeColor="#333333" GridLines="None" Width="165px">
<Columns>
<asp:TemplateField>
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:CheckBox ID="CB" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
I want to get a value of checked textbox into another textbox which is outside gridview using javascript.
Since texbox placed in an EditItemTemplate you need to switch gridview to edit mode before. So as it is right now you can’t get textbox value on javascript on checkbox click.
You may add hidden field next to checkbox and bind it’s value to text that you want to display in outer textbox on checkbox click.