function addRowToTable() { var tbl = document.getElementById('tblSample'); var lastRow = tbl.rows.length; // if there's no header row in the table, then iteration = lastRow + 1 var iteration = lastRow; var row = tbl.insertRow(lastRow); row.className="tableitem_"+lastRow%2 // cell 0 var cell_0 = row.insertCell(0); cell_0.width = 20; var textNode = document.createTextNode(iteration+1); cell_0.appendChild(textNode); // cell 1 var cell_1 = row.insertCell(1); cell_1.width = 150; var el = document.createElement('input'); el.type = 'text'; el.name = 'tarih_' + iteration; el.id = 'tarih_' + iteration; //el.disabled = "true" el.size = 8; el.className="textbox"; cell_1.appendChild(el); var el = document.createElement('img'); el.id = 'btntarih_' + iteration; el.src = "http://www.mazars.com.tr/upload/www/raporlar/images/takvim.jpg"; cell_1.appendChild(el); Calendar.setup({ inputField : 'tarih_' + iteration, // id of the input field ifFormat : "%d.%m.%Y",//"%m/%d/%Y %I:%M %p", // format of the input field showsTime : false, // will display a time selector button : 'btntarih_' + iteration, // trigger for the calendar (button ID) singleClick : false, // double-click mode step : 1, // show all years in drop-down boxes (instead of every other year as default) electric : false }); // cell 2 var cell_2 = row.insertCell(2); cell_2.width = 150; var el = document.createElement('input'); el.type = 'text'; el.name = 'bakiye_' + iteration; el.id = 'bakiye_' + iteration; el.onblur = calculateadat el.onkeyup = formatCurrency2 el.setAttribute('maxLength',13); el.className="currency"; el.size = 10; cell_2.appendChild(el); var textNode = document.createTextNode(","); cell_2.appendChild(textNode); var el = document.createElement('input'); el.type = 'text'; el.name = 'bakiyekrs_' + iteration; el.id = 'bakiyekrs_' + iteration; el.onblur = calculateadat el.setAttribute('maxLength',2); el.size = 1; el.className="textbox"; cell_2.appendChild(el); // cell 3 var cell_3 = row.insertCell(3); cell_3.width = 150; var el = document.createElement('input'); el.type = 'text'; el.name = 'kasa_' + iteration; el.id = 'kasa_' + iteration; el.disabled = "true" el.size = 8; el.className="currency"; cell_3.appendChild(el); // cell 4 var cell_4 = row.insertCell(4); cell_4.width = 150; var el = document.createElement('input'); el.type = 'text'; el.name = 'faiz_' + iteration; el.id = 'faiz_' + iteration; el.disabled = "true" el.size = 8; el.className="currency"; cell_4.appendChild(el); } function startcalculation() { document.getElementById("tblhesaplayici").style.display="block"; var tbl = document.getElementById("tblSample"); rowcount = tbl.rows.length for(i=0;i<10-rowcount;i++) { addRowToTable(); } var tbl = document.getElementById("tblSample"); mytablebody = tbl.getElementsByTagName("tbody")[0]; myrow = mytablebody.getElementsByTagName("tr")[0]; mycel_tarih = myrow.getElementsByTagName("td")[1]; mycel_bakiye = myrow.getElementsByTagName("td")[2]; mycel_kasa = myrow.getElementsByTagName("td")[3]; mycel_faiz = myrow.getElementsByTagName("td")[4]; if(mycel_tarih.childNodes[0].value == "") { mycel_tarih.childNodes[0].value = document.getElementById("txtTARIH").value mycel_tarih.childNodes[1].style.display = "none"; mycel_bakiye.childNodes[0].value = "" mycel_bakiye.childNodes[0].disabled = "true" mycel_kasa.childNodes[0].value = "" mycel_faiz.childNodes[0].value = "" } else { for(i=0;i