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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:37:55+00:00 2026-06-13T08:37:55+00:00

having trouble finding the input element in the next td . I need to

  • 0

having trouble finding the input element in the next td. I need to get place a value into the td class of tblCashSum’s textbox.

However, if I do the following:

alert(formElement.nextAll('td.tblCashSum').find('input.cashSum').val());

It reads undefined.

HTML:

<tr>
    <td class='tblCashType'>100</td>
    <td class='tblCashAmount'><asp:TextBox class="inputBox" ID="noteAmount100" runat="server"></asp:TextBox></td>
    <td class='tblCashSum'><asp:TextBox class="inputBoxDisabled cashSum" ReadOnly="true" runat="server" ID="cashSum100"></asp:TextBox></td>
</tr>

Jquery:

$("noteAmount").blur(function(){
 calc($(this));
});

function calc(formElement)
{
    a = formElement.val();
    b = formElement.closest('td').siblings('td.tblCashType').text();
    x = a * b;
    formElement.nextAll('td.tblCashSum').find('input.cashSum').val(x);
}
  • 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-13T08:37:56+00:00Added an answer on June 13, 2026 at 8:37 am

    You are passing a string which is the value of the input element, you should first pass the object instead, note that you have missed the # for the ID selector.

    $("#noteAmount").blur(function(){
         calc($(this));
    });
    

    Then you can use parent and next methods:

    function calc($formElement) {
        a = parseInt($formElement.val(), 10);
        b = parseInt($formElement.closest('td').siblings('td.tblCashType').text(), 10);
        x = a * b;
        $formElement.parent().next().find('input.cashSum').val(x);
    }
    

    Please note that if your elements have ID attributes you can select them directly which is faster than traversing the DOM.


    I can’t find an element with ID of noteAmount in your markup, if you have multiple elements with the same IDs your markup becomes invalid and you will get unexpected results , you can also try the following:

    $('.inputBox').blur(function(){
        a = this.value
        $this = $(this);
        b = $this.parent().prev().text();
        x = parseInt(a, 10) * parseInt(b, 10);
        $this.parent().next().find('input.cashSum').val(x);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble finding a simple example of how to get the video
I'm having trouble finding an elegant way to allow for date/time input in an
I am having trouble finding a good place to start learning assembly. I have
I've been having trouble finding out how to convert a JSON array into an
I'm having trouble finding the answer to this question anywhere. I am in need
Having trouble finding an explanation in the docs, would someone be kind enough to
I am having trouble finding an answer to this. Consider the clipping code below:
I'm having trouble finding a way to do this in a way that doesn't
I'm having trouble finding info right now; it might still be too early. But
I'm having trouble finding the right syntax to replace an array of objects nested

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.