<asp:GridView ID="GridView1">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:DropDownList></asp:DropDownList>
<input type="tel" id="contract">
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label><asp:Label>
<asp:Label><asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<input type="tel" id="Hours">
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
I am trying to use JQuery as a quick way to validate the template fields in my GridView. For example, if the SelectedValue of my DropDownList = RENT READY, then the Hours input should not be blank. So I want to use JQuery to get a count of all times that I can narrow down to a select with a value of RENT READY whose corresponding Hours input = blank. I’ve tried:
$("#GridView1 select[value=RENT READY]").find("input[type=tel]").eq(1)
and
$("#GridView1 select[value=RENT READY]").next("input[type=tel]").next("input[type=tel]")
and
$("#GridView1 select[value=RENT READY]").next("input[type=tel value=''])
But always returns undefined. The select piece works just fine. It has no problem finding the selects with a value of RENT READY. It’s the 2nd piece where I try to narrow it down further to just the selects with an input relative 2 doors down with a blank value that isn’t working.

Edit: Final Code
$('#GridView1 select').filter(function () {
return ($(this).val() == 'RENT READY');
}).closest('tr').find('input[type=tel]').filter(function () {
return ($(this).val() == "" && $(this).attr("id") == "Hours");
}).length
I don’t think that is a valid way to select a drop down with value “RENT READY”.
You should do it like below,
To get the
telfind the closesttrand do a find.. or you can do.next .nexton select parent.