Hello all I have a grid view which is bot bound with database but it is bound with datatable. Grid view has an empty row when first time the page is loaded. I am using this grid to insert data in database. Whenever user inserts a data in first row and clicks on "Add New Row" button, a new row is created. Now my problem is when user clicks on button I want to validate if there is any empty controls. So that I want to add javascript. I have trid many scripts but its not working. please guide me.
My grid view is as bellow.
Qualification Detail
Qualification
--Select--
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Percentage
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="percentageBox" clientID="percentageBox" name="percentageBox" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Passing Year
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="yearBox" clientID="yearBox" name="yearBox" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<HeaderTemplate>
Institute Name
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="instituteNameBox" clientID="instituteNameBox" name="instituteNameBox" runat="server"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#E2DED6" ForeColor="#333333" Font-Bold="True" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#999999" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="addRowBtn" EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
<br />
</td>
</tr>