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 7563823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:45:47+00:00 2026-05-30T13:45:47+00:00

I don’t have ID’s to look at since some rows are inserted dynamically via

  • 0

I don’t have ID’s to look at since some rows are inserted dynamically via clone.

I’m looking for the value of the systemname which corresponds to the Check System button is clicked.

Here is the function:

function getSystemInfo(btn){    
    var buttonClicked = $(btn);
    var firstSystemName = buttonClicked.parent().next().find($("input.systemname"));
    alert( $(firstSystemName).val() );
}            

Here is the generated source code:

<div name="singleSystemDiv" class="offset-bg">
    <div class="field inline">
    <label class="frmFlds_labels">System Name</label>
    <input name="systemname" class="systemname" size="15" value="d1cti1d4" type="text">
    </div>
    <div class="field inline">
    <label class="frmFlds_labels">Location</label>
        <select id="location" name="location">
            <option value=""></option>
            <option value="Akron">Akron</option>
            <option value="Allen">Allen DC - Mob</option>
            <option value="Alpharetta">Alpharetta - Mob</option>
        </select>
    </div>
    <div class="field inline">
    <label class="frmFlds_labels">Platform</label>
        <select id="platform" name="platform" onChange="updateModels(this);" class="platform">
            <option value=""></option>
            <option value="IBM" selected="selected">AIX</option>
        </select>
    </div>
    <div class="buttons">
        <input value="Remove System" onClick="removeSystemRow(this);" type="button">
        <input value="Check System" onClick="getSystemInfo(this);" type="button">
    </div>
</div>

The way I have this written, my alert is firing, undefined.

I seem to have to ask a lot of SO questions regarding traversing. If anyone has a web site that demonstrates this, please post that. jQuery’s docs regarding .next(), parents(), etc, aren’t doing it for me.

  • 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-30T13:45:49+00:00Added an answer on May 30, 2026 at 1:45 pm

    Try this:

    function getSystemInfo(btn){    
        var buttonClicked = $(btn);
        var $firstSystemName = buttonClicked.closest("div[name='singleSystemDiv']").find($("input.systemname"));
        alert($firstSystemName.val());
    }  
    

    Example fiddle

    Alternatively, you could use buttonClicked.parent().parent().find($("input.systemname")); but I personally find chained parent() calls a bit ugly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Don't they both have to convert to machine code at some point to execute
Don't you hate it when you have class Foobar { public: Something& getSomething(int index)
I have just tried to save a simple *.rtf file with some websites and
Don't overthink this - there's a very commonly used term and I ... have
Don't have much to say, just can get into the event handler. XAML: <Grid>
Don't these two mean the same thing, first get the value and then increment?
Don't ask why but I have the requirement to draw a border around certain
DON'T ASK WHY but... I have a regex that needs to be case insensitive
Don't know if this has been answered before. Have custom routes to users. If
I don't have any experience in updating a Rails app and when I google

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.