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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:02:09+00:00 2026-05-25T19:02:09+00:00

I am getting the last element of the form which has got value, now

  • 0

I am getting the last element of the form which has got value, now i want to find the id of next input element which is in next div…

 var elem1 =$(':text[name^=distanceSlab][value!=""]').last(); 
 var nextElemId = // find the id of next input element which is in next div

the corresponding html code is

 <div id ="divid4">
  <input type="text"  id ="slab4" value ="1"/> // this is the last elemnt which has value
 </div>

 <div id ="div1d5">
      <input type="text"  id ="slab5" value =""/> // need to find the id of this element
 </id>
  • 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-25T19:02:10+00:00Added an answer on May 25, 2026 at 7:02 pm

    Assuming that you’re starting from the input that you’ve already identified, then:

    $(this).closest('div').next('div').find('input:text').attr('id');
    

    JS Fiddle.

    Or:

    var thisIndex = $(this).index('input:text');
    
    var next = thisIndex + 1;
    
    var nextElemId = $('input:text').eq(next).attr('id');
    

    JS Fiddle.

    I’d probably put those into a blur(), or similar, event.

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

Sidebar

Related Questions

I am getting the last element from a form which has a value like
I'm getting error to store array value in database. My last array value is
[EDIT] original title of this question was Getting the last element of a Postgres
Getting this error while trying to erase the last element of a list. I
For some reason, the 'continue' class isn't getting added (last line). function getBlogs(element, url,
I am trying to replicate a forum function by getting the last reply of
My last question was about getting the string representation of an object serialized to
SOLVED in the last answer im getting following error, dunno where and why? cause
without getting too verbose....i have been learning AS3 over the last week by building
Possible Duplicate: Getting the timestamp from last saturday (every week)? If today is Sunday,

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.