Hello all,
I have a function that dynamically adds rows and columns to the page.
Everything works well except onfocus // onblur attributes. For some
reason, when entering the input box it doesn't highlight. If I delete
the onblur line, each of the boxes is highlighted all the time
regardless of focusing the input box.
Can someone help me?
Tzachi
var addrownum=0;
function addRow(id){
var tbody = document.getElementById(id).getElementsByTagName(" TBODY")
[0];
var row = document.createElement("TR");
var td = new Array();
var y = 0;
addrownum++;
for (var y=1;3>=y;y++) {
td[y] = document.createElement("TD");
td[y].setAttribute("align","right");
S = document.createElement("input");
S.setAttribute("type","text");
S.setAttribute("name","c"+y+"r"+addrownum);
S.setAttribute("id","c"+y+"r"+addrownum);
S.setAttribute("dir","rtl");
S.setAttribute("class","box");
S.setAttribute("size","33%");
S.setAttribute("maxlength","33%");
// main problem
S.setAttribute("onFocus",S.className="box_on");
S.setAttribute("onBlur",S.className="box");
// end of main problem
td[y].appendChild(S);
row.appendChild(td[y]);
} // end of for loop
tbody.appendChild(row);
} // end of func