Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: [Javascript] createElements(): new row in table
- From: borchers at tridem.de (Michael Borchers)
- Subject: AW: [Javascript] createElements(): new row in table
- Date: Wed Sep 28 05:57:01 2005
> >> <http://michaelborchers.net/js/dom2.php> http://michaelborchers.net/js/dom2.php so far so good, adding a single cell in a row with an id works fine, but i can't add a complete row. please see the script which was supposed to do both, what's wrong? function addOrdersNumRows() { var ordersNumRowsAdded = document.getElementById("orders_num_rows_added").value; for(o=0;o<ordersNumRowsAdded;o++) { mycurrent_row=document.createElement("TR"); mycurrent_cell=document.createElement("TD"); mySelect = document.createElement("select"); mySelect.setAttribute("name","products_id[1][products_id]"); theOption=document.createElement("OPTION"); theText=document.createTextNode("Produkte"); theOption.appendChild(theText); theOption.setAttribute("value","1"); mySelect.appendChild(theOption); mycurrent_cell.appendChild(mySelect); mycurrent_row.appendChild(mycurrent_cell) ; var tbody = document.getElementById("tableProducts").tBodies[0]; } // for } <<<< found the solution: you HAVE to use the tbody tag: var tbody = document.getElementById("tableProducts").tBodies[0]; -------------- n?chster Teil -------------- Ein Dateianhang mit HTML-Daten wurde abgetrennt... URL: http://lists.LaTech.edu/pipermail/javascript/attachments/20050928/f0af5ed3/attachment.html
- Prev by Date: [Javascript] createElements(): new row in table
- Next by Date: [Javascript] counting selects
- Previous by thread: [Javascript] createElements(): new row in table
- Next by thread: [Javascript]Thanks thank you very much
- Index(es):