Validate Grid view controls with javascript
<p>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.</p>

<p>My grid view is as bellow.</p>

<p>
        
                <b>Qualification Detail</b>
        
                                    
                                
    
    
        
               
                
                
                <br>
                  
                   
                     
                         
                             
                             
                                 
                                     
                                         Qualification
                                     
                                     
                                          
                                         --Select--</p>

<pre><code>                                     &lt;/asp:DropDownList&gt;
                                 &lt;/ItemTemplate&gt;
                             &lt;/asp:TemplateField&gt;
                             &lt;asp:TemplateField&gt;
                                 &lt;HeaderTemplate&gt;
                                     Percentage
                                 &lt;/HeaderTemplate&gt;
                                 &lt;ItemTemplate&gt;
                                     &lt;asp:TextBox ID="percentageBox" clientID="percentageBox" name="percentageBox" runat="server"&gt;&lt;/asp:TextBox&gt;
                                  &lt;/ItemTemplate&gt;
                             &lt;/asp:TemplateField&gt;
                             &lt;asp:TemplateField&gt;
                                 &lt;HeaderTemplate&gt;
                                     Passing Year
                                 &lt;/HeaderTemplate&gt;
                                 &lt;ItemTemplate&gt;
                                     &lt;asp:TextBox ID="yearBox"  clientID="yearBox" name="yearBox" runat="server"&gt;&lt;/asp:TextBox&gt;
                                     &lt;/ItemTemplate&gt;
                             &lt;/asp:TemplateField&gt;
                             &lt;asp:TemplateField&gt;
                                 &lt;HeaderTemplate&gt;
                                     Institute Name
                                 &lt;/HeaderTemplate&gt;
                                 &lt;ItemTemplate&gt;
                                     &lt;asp:TextBox ID="instituteNameBox" clientID="instituteNameBox" name="instituteNameBox" runat="server"&gt;&lt;/asp:TextBox&gt;
                                    &lt;/ItemTemplate&gt;
                             &lt;/asp:TemplateField&gt;
                         &lt;/Columns&gt;
                         &lt;FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
                         &lt;PagerStyle BackColor="#284775" ForeColor="White" 
                             HorizontalAlign="Center" /&gt;
                         &lt;SelectedRowStyle BackColor="#E2DED6" ForeColor="#333333" Font-Bold="True" /&gt;
                         &lt;HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /&gt;
                         &lt;EditRowStyle BackColor="#999999" /&gt;
                         &lt;AlternatingRowStyle BackColor="White" ForeColor="#284775" /&gt;
                     &lt;/asp:GridView&gt;
                   &lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/table&gt;
              &lt;/ContentTemplate&gt;
                &lt;Triggers&gt;
                &lt;asp:AsyncPostBackTrigger ControlID="addRowBtn" EventName="Click"/&gt;
                &lt;/Triggers&gt;

            &lt;/asp:UpdatePanel&gt;
            &lt;br /&gt;
    &lt;/td&gt;
&lt;/tr&gt;
</code></pre>
