JQuery:bind.blur() is not working

Posted by user198880 on Stack Overflow See other posts from Stack Overflow or by user198880
Published on 2010-06-18T05:46:26Z Indexed on 2010/06/18 5:53 UTC
Read the original article Hit count: 146

Filed under:

Hello, I need to add a row to a table.I am using jQuery to add the row.But i my Add() function everyhing is working fine except that the blur function for the input fild "txtQuantity" is not getting triggered for the newly added row.Here is my function,

function Add()
{
var rowPart = $('#trPart0').clone(true).show().insertAfter('#tblPart tbody>tr:last');   
var index = document.getElementById("hdnMaxPartId").value;   
$("#tblPart tbody>tr:last").attr("id", "trPart" + index);
$("td:eq(0) img", rowPart).attr("id", "imgPartDelete" + index).attr("onclick", "");  
$("td:eq(1) input:eq(0)", rowPart).attr("id", "hdnWODefPartId" + index);
$("td:eq(1) input:eq(1)", rowPart).attr("id", "hdnPartCost" + index); 
$("td:eq(1) input:eq(3)", rowPart).attr("id", "txtPart" + index).attr("name",     "txtPart" + index).attr("onkeyup", "");  
$("td:eq(2) input", rowPart).attr("id", "txtQuantity" + index).attr("onblur", "");
$("td:eq(3) div", rowPart).attr("id", "divPartCost" + index);      
$("td:eq(4) div", rowPart).attr("id", "divPartUnit" + index);   

$("#imgPartDelete" + index).unbind().bind('click', function() {
        DeletePart(index);
    }
 ); 

 $("#txtPart" + index).unbind().bind('keyup', function() {          
        ajax_showOptions(this,"getPartForAC",event,2,"replace","div_part_list"+index);
    }
 ); 
 $("#txtQuantity" + index).unbind().bind('blur', function() {   
        ChangeClassForObject(this,"clsSpText_blur");          
        CalculateCost(index,this,"divPartCost"+index);            
    }
 );     

}

© Stack Overflow or respective owner

Related posts about jQuery