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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:41:09+00:00 2026-05-20T16:41:09+00:00

I have the following HTML : <tr class="wiring_details_6-48"> <td colspan="2"> Wire Type: <select name="select_wire_6"

  • 0

I have the following HTML:

<tr class="wiring_details_6-48">
    <td colspan="2"> Wire Type:
        <select name="select_wire_6" onchange="Estimate.select_wire( 6, this.value, 0 );">
            <option value="" selected="">Select wire..</option>
            <option value="1">14/2</option>
            <option value="2">14/4</option>
            <option value="3">16/4</option>
            <option value="4">16/2</option>
            <option value="5">RG6</option>
            <option value="6">CAT5</option>
            <option value="7">RG59</option>
            <option value="8">LVT</option>
            <option value="9">CAT6</option>
            <option value="10">HDMI</option>
            <option value="11">Shielded CAT6</option>
        </select> </td>
    <td colspan="2">Length:
        <input type="text" class="id_wire_length_6" name="wire_length_6" value="0"></td>
    <td colspan="2">Retail Price:
        <input type="text" class="id_wire_retail_6" name="wire_retail_6" value="0"> </td>
    <td colspan="2">
        <input type="hidden" id="wire_id_6" name="wire_id_6" value="0"> </td>
</tr>

I want to make sure that input – id_wire_length and id_wire_retail are related to their parent tr this can be proven due to the part-id which is in this example the number 6 in wiring_details and in id_wire_length and id_wire_retail.

The JS that I have is:

$('input[class^="id_wire_retail"]').each(function() {
    parts_cents_total += (Money.dollars_to_cents($(this).val()) * $('input[class^="id_wire_length"]').val());
});

The above matches the id_wire_detail part as well as the id_wire_length – but how do I make sure that it is the one related to its parent,

So I guess it comes down to this:

How do I get the parent tr‘s part number (6) and then make sure that the above JS matches only input elements with the tr‘s part number in them?

  • 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-20T16:41:10+00:00Added an answer on May 20, 2026 at 4:41 pm

    Instead of this:

    $('input[class^="id_wire_length"]').val()
    

    …try this:

    $(this).closest('tr').find('input[class^="id_wire_length"]').val()
    

    This will ensure that the value you’re selecting is the one “inside” the same <tr>. Assuming the HTML structure is as you’ve posted above, you shouldn’t have to worry about matching by part number.

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

Sidebar

Related Questions

I have the following HTML dinamically generated: ... <tr> <td><input type=text class=q value=5 name=q[]
I have the following HTML <select> element: <select id=leaveCode name=leaveCode> <option value=10>Annual Leave</option> <option
Lets say i have the following web page: <html> <body> <div class="transform"> <span>1</span> </div>
I have a HTML with the following format <article class="cik" id="100"> <a class="ci" href="/abc/1001/STUFF">
I have the following HTML: <ul class="main-navigation"> <li class="left">&nbsp;</li> <li class="normal">Home</li> <li class="normal">Internet</li> <li
I have the following HTML. <input type=text class=embeddedLabel /> And I wish to tie
I have the following HTML: <div class="selfClear" style="float: left; border: 1px solid black;"> ...floated
I have the following html: <a href="#" id="#1" class="pagerlink" >link</a> <a href="#" id="#3" class="pagerlink"
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
So I have some html that looks like the following: <div class='something unknown' id='something_unknown_1'>

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.