Hi all. I need JavaScript to validate that atleast one checkbox has been checked in a form before the record(s) can be deleted.
- I have an <asp:button id="btnDelete". ..> and the checkbox is created via grdData_ItemDat aBound with id="chkRecordId ":
How do I achieve this? Any help would be greatly appreciated.
Thanks.
- I have an <asp:button id="btnDelete". ..> and the checkbox is created via grdData_ItemDat aBound with id="chkRecordId ":
Code:
Protected Sub grdData_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles grdData.ItemDataBound If e.Item.ItemType <> ListItemType.Header And e.Item.ItemType <> ListItemType.Footer Then [B]e.Item.Cells(1).Text = "<input type='checkbox' name='chkRecordId' value='" & e.Item.Cells(0).Text & "'/>"[/B] End If End Sub
Thanks.
Comment