I would like to hide label and grid view in javascript.
I had succeed to hide images and checkboxes but not yet label and grid view.
How to do it using javascript?
javascript
<script type="text/javascript">
function txtOnKeyPress(txt1)
{
if (txt1 != 'undefined')
{
document.getElementById("GVPaymentDetails").style.display='none';
document.getElementById('LblValidReg').style.display='none';
}
}
</script>
aspx code
<asp:TextBox ID="txtRegno" runat="server" AutoPostBack="false"
MaxLength="10" onkeydown="txtOnKeyPress(this);"></asp:TextBox>
<asp:GridView ID="GVPaymentDetails" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px"
CellPadding="4" GridLines="Horizontal" EmptyDataText="No Records Found">
<RowStyle BackColor="White" ForeColor="#333333" />
<Columns>
<asp:BoundField HeaderText="Enquiry id" DataField="EnquiryId" />
<asp:BoundField HeaderText="Reg Number" DataField="RegistrationNumber" />
<asp:BoundField HeaderText="Name" DataField="Name" />
</Columns>
<FooterStyle BackColor="White" ForeColor="#333333" />
<PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
</asp:GridView>
<asp:Label ID="LblValidReg" runat="server"></asp:Label>
divorasp:Paneland hide that? Then you're only dealing with one object instead of two.