Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8057897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:10:53+00:00 2026-06-05T09:10:53+00:00

<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>

  • 0
<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.

enter image description here

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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:10:55+00:00Added an answer on June 5, 2026 at 9:10 am

    I don’t think that is a valid way to select a drop down with value “RENT READY”.

    You should do it like below,

    $('#GridView1 select').filter(function () {
        return ($(this).val() == 'RENT READY');
    }) 
    

    To get the tel find the closest tr and do a find.. or you can do .next .next on select parent.

    $('#GridView1 select').filter(function () {
        return ($(this).val() == 'RENT READY');
    }).closest('tr').find('input[type=tel]')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Gridview <asp:GridView ID=GridView1 runat=server Width=400px AutoGenerateColumns=false OnSelectedIndexChanged=GridView1_SelectedIndexChanged1> <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox
<asp:GridView ID=GridView1 runat=server> <Columns> <asp:TemplateField HeaderText=FileName> <ItemTemplate> <asp:HyperLink ID=HyperLink1 runat=server NavigateUrl= Text=></asp:HyperLink> </ItemTemplate> </asp:TemplateField>
<asp:GridView ID=GridView1 runat=server CssClass=style29> <Columns> <asp:TemplateField HeaderText=Send Message to Group> <ItemTemplate> <asp:LinkButton ID=LinkButton2 runat=server
<asp:GridView ID=GridView1 runat=server AutoGenerateColumns=false Height=146px Width=308px> <Columns> <asp:TemplateField HeaderText=Original Price ControlStyle-Width=100px> <ItemTemplate> <asp:TextBox ID=txtOriginalPrice
protected void GridView1_DataBound(object sender, EventArgs e) { GridView1.Columns[0].ItemStyle.Width = 400; <asp:GridView ID=GridView1 runat=server DataSourceID=ObjectDataSource1
Well, I have GridView with editable field like 'TemplateField' with DropDownList. My code: <Columns>
I use the following code to display a tooltip <asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False DataKeyNames=ID
<asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False DataKeyNames=ID DataSourceID=SqlDataSourceVideo > <Columns> <asp:BoundField DataField=VideoUrl HeaderText=VideoUrl SortExpression=VideoUrl /> <asp:BoundField
I want to add a dropdownlist to every entry in a gridview. <asp:GridView ID=GridView1
<asp:GridView ID=GridView1 runat=server AutoGenerateColumns=False Width=596px DataKeyNames=Key > <Columns> <asp:BoundField DataField=Key HeaderText=Key SortExpression=key Visible=False />

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.