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

  • SEARCH
  • Home
  • 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 355231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:59:55+00:00 2026-05-12T11:59:55+00:00

I have an array of input controls garnered like so: var hiddenInputs = $(input[id^=’Unanswered’])

  • 0

I have an array of input controls garnered like so:

   var hiddenInputs = $("input[id^='Unanswered']")

Each hidden input resides in a container which has another control which I am interested in getting the value of.

I iterate over the array of hiddenInputs

   $.each(hiddenInputs, function(i, val) {

Now, the element I would like to find belongs in the same container, so I can traverse up the DOM to the parent and then I want to get at element(s) which have the id which contains the text ‘mainInputControl’

    var question = $(val).parent("input[id*='mainInputControl']");

    });

I am expecting the a shiny JQuery object to be nestling in question. What am I doing wrong?

Edit…
For some further insight. This is what is in the children of the parent node: [input#Unanswered, input#ctl00_ContentPlaceHolder1_renderingEngine_ctl01_0_ctl00_0_ctl00_mainInputControl.hasDatepicker] I would like to get at second of these controls! Maybe I need to do the attribute selection within the children method()….

  • 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-05-12T11:59:55+00:00Added an answer on May 12, 2026 at 11:59 am

    Im not sure if it is bad form to answer to yourself but here is the answer. Hope it helps

    var hiddenInputs = $("input[id^='Unanswered']")
    
    $.each(hiddenInputs, function(i, val) {
        var question = $(val).parent().children("[id*='mainInputControl']");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input array like <input id='delete[18]' name=delete[18] value=1 type=checkbox> <input id='delete[19]' name=delete[19]
I need to have an array_search search my array strictly making sure that the
Say I have an array of size 5. I want to take an index
my input array has: results[num_row] = { 'title': title, 'url': url, 'support_url': support_url, 'description':
I have a fairly simple script but something is going wrong and I can't
I want to get total of elements of each row at the end of
this is my code snippet, where the program doesn't enter the foreach loop: var
I love programming languages and trying to think of logical solutions to problems. A
I am beginning to explore using probability in my robotics applications. My goal is
I've been working with JQGrid a lot, and would recommend it to everyone. The

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.