I want to add row in a table via script, and the row contains a text box where I want to add an onblur function for it, here is my code:
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
Problem is "checkQty(this)" is just interpreted as a string, not a function reference. However, checkQty(this) (without quotes) does reference the function, but interprets "this" in it's current context, which happens to be the windowObject. Lastly, checkQty(qty) works once! For some reason it fires at the moment of assignment, but then qty goes out of scope and you're basically calling checkQty(null) after that.
Sorry...I forget that not everyone speaks in diff...it won't work if you try to set onblur() directly. Replace the top line with the bottom line and you should be set. (On FF anyway...that's all I tested).