Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer IE Problem with Javascript

    Hey Guys,

    Wondering if anyone can give me a handon this problem.

    Can you look at the code and tell me why it would work in safari/chrome/ff and not in IE6/7/8 ?

    Here's a snippet :

    function addRow() {

    var $tr = $("#timeSheet").find('tr:last').prev().prev().clone();
    $tr.find('input').attr('name', function(){
    var parts = this.name.match(/(\D+)(\d+)$/);
    return parts[1] + (parseInt(parts[2]) + 2);
    });
    $tr.find('input').attr('id', function(){
    var parts = this.name.match(/(\D+)(\d+)$/);
    return parts[1] + (parseInt(parts[2]));
    });
    $tr.find('select').attr('name', function(){
    var parts = this.name.match(/(\D+)(\d+)$/);
    return parts[1] + (parseInt(parts[2]) + 2);
    });
    $tr.find('select').attr('id', function(){
    var parts = this.name.match(/(\D+)(\d+)$/);
    return parts[1] + (parseInt(parts[2]));
    });
    $tr.find('span').attr('id', function(){
    var parts = this.id.match(/(\D+)(\d+)$/);
    return parts[1] + (parseInt(parts[2]) + 2);
    });
    var $currPos = parseInt($tr.attr("position"));
    $currPos = $currPos + 2;

    $tr.attr({ "position": $currPos });

    $tr.find(".logStartHrTime").change(function() {
    checkRowHrTime(this);
    adjustTotal(this);
    });

    $tr.find('.logStartMinTime').change(function() {
    /*checkRowMinTime(this);*/
    adjustTotal(this);
    });

    $tr.find(".logStopHrTime").change(function() {
    checkRowHrTime(this);
    adjustTotal(this);
    });

    $tr.find('.logStopMinTime').change(function() {
    /*checkRowMinTime(this);*/
    adjustTotal(this);
    });

    $("#timeSheet tr:last").before($tr);

    }

    Let me know if anything stands out

    j_yaskiw@hotmail.com

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    1. Does the HTML you're running this against validate?
    2. If so, please post it.
    3. Can you give a more descriptive summary of the problem than "doesn't work"?


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •