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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:15:10+00:00 2026-06-06T03:15:10+00:00

I have the following function that works properly in Chrome and Firefox, but not

  • 0

I have the following function that works properly in Chrome and Firefox, but not in IE7.
The function is supposed to run on every instance of a row in the selected table. In IE 7 it only runs once.

function rowTotalit(targee) {
    var sum = 0;
    var thisRow = targee.closest('tr');
    thisRow.find('td.tmipt input').each(function() {
        var numChk = $(this).val();
        sum = sum + Number(numChk);
        thisRow.find('.total').fadeOut(200, function() {
            $(this).html(sum);
            $(this).fadeIn(500);
            $(this).val(sum);
        });
        thisRow.find('.total').next().val(sum);
    });
}​

Here is the trigger from within another function:

for (trs = 1; trs <= tblerows; trs++) {
    $("#testingmsg").append("ARGH!!" + trs);
    rowTotalit($("#timeChart tr:nth-child(" + trs + ")"));
}​

Output of the testingmsg div in Chrome and Firefox is:

ARGH!!1ARGH!!2ARGH!!3ARGH!!4ARGH!!5ARGH!!6ARGH!!7

In IE7 it’s:

ARGH!!1ARGH!!2

So the output is telling me that the function gets to the each statement within the function and dies in IE. Anyone have any ideas?

UPDATE:
The function that holds the for loop is triggered by a click event on a button:

function addEmAllUp(){
    var tblerows = ($('#timeChart tr').length - 2);
    alert(tblerows);
    for (trs = 1; trs <=tblerows; trs++){
        $("#testingmsg").append("ARGH!!" + trs);
        rowTotalit($("#timeChart tr:nth-child(" + trs +")"));
    }
}

When I click the button more than once, the function increments by 1. So I press it twice, it goes to the second row, third time gets me the third row, etc.

Here is an example of the table row HTML:

 <tr class="timerow">
    <td class='projName' >Holiday<br /><span class='small'>999906</span></td>
<td class="tmipt" align="center"><input type="text" class="numbersOnly  alertME"  name="999906[]" value="0.00" /></td>
    <td class="tmipt" align="center"><input type="text" class="numbersOnly  alertME"  name="999906[]" value="0.00" /></td>
    <td class="tmipt" align="center"><input type="text" class="numbersOnly "  name="999906[]" value="0.00" /></td>
    <td class="tmipt" align="center"><input type="text" class="numbersOnly "  name="999906[]" value="0.00" /></td>
    <td class="tmipt" align="center"><input type="text" class="numbersOnly "  name="999906[]" value="0.00" /></td>
    <td class="tmipt" align="center"><input type="text" class="numbersOnly "  name="999906[]" value="0.00" /></td>
    <td class="tmipt" align="center"><input type="text" class="numbersOnly "  name="999906[]" value="0.00" /></td>
    <td align="center"><div id="total_1" class="total">0.00</div><input type="hidden" name="total_999906" class="total" value="0.00" /></td>
    </tr>
  • 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-06T03:15:12+00:00Added an answer on June 6, 2026 at 3:15 am

    Got it!!

    There is another find() statement inside the each() that was killing the each prematurely.

    thisRow.find('.total').fadeOut(200, function() {
                $(this).html(sum);
                $(this).fadeIn(500);
                $(this).val(sum);
            });
            thisRow.find('.total').next().val(sum);
    

    I just moved the above code out of the each statement and it works properly.

    For anyone who may be suffering with the same problem of IE not running your .each() properly, here is how I debugged my problem.

    if($.browser.msie){
    alert(someTestValue);
    }
    

    I used the above condition to test out different portions of my code for IE only and that not only helped to narrow down what was wrong, but I was able to keep my working code in tact for FF & Chrome.

    My final solution was to acutally use the browser if statement to run a different function for IE and another for FF & Chrome.

    Thanks to those that offered your help. Hope this helps someone else.

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

Sidebar

Related Questions

I have the following code that works on Firefox and Chrome $("#adicionarItem").click(function(){ $.ajax({ type:
I have the following Obj C function that works properly: NSString* myfunc( int x
I have the following function that works properly, except for when you use the
I have the following Javascript code that works perfectly: $(document).ready(function() { $(#Select1).setDefault(); $(#Select2).setDefault(); $(#Select3).setDefault();
I have the following function that is supposed to trigger anytime one of the
I have the following function that I only want to run inside <div id=imgWrapper>
I have a script that works in Firefox, Safari, and Chrome. It just doesn't
I have the following function that does string splitting: on splitText(aString, delimiter) set retVal
I have the following function that deletes the LaTeX command surrounding the current cursor
I have the following function that I am using to remove the characters \04

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.