aido179
12-01-2009, 12:23 PM
hi all, i think im in the right place, if not, feel free to move.
I am an IT student and currently working on an assignment involving creating a form in javascript to deal with inputs about an energy audit.
Im using a function called addRoom() to add a new row, cells and innerHTML to a table.
Code:
function addRoom()
{
if (roomApps > 0 || currentRow == 0)
{
var x=document.getElementById('table1').insertRow(currentRow);
var cell0=x.insertCell(0);
cell0.innerHTML="<td><div id='frmName'<b><input name='roomName' value='Room'</b></div></td>"
cell0.colSpan="2";
currentRow+=1;
roomApps=0
}
}I want to take what the user inputs into the text field 'roomName' and use another function addAppliance() to change the innerHTML in the cell to it.
I will also have to access multiple more inputs in other cells so just accessing the last row in the table wouldn't be helpful as far as learning for the rest of the project goes.
if you could offer any help it would be greatly appreciated
full source here:
http://www.filefactory.com/file/a1fgb05/n/Energy_.txt
I am an IT student and currently working on an assignment involving creating a form in javascript to deal with inputs about an energy audit.
Im using a function called addRoom() to add a new row, cells and innerHTML to a table.
Code:
function addRoom()
{
if (roomApps > 0 || currentRow == 0)
{
var x=document.getElementById('table1').insertRow(currentRow);
var cell0=x.insertCell(0);
cell0.innerHTML="<td><div id='frmName'<b><input name='roomName' value='Room'</b></div></td>"
cell0.colSpan="2";
currentRow+=1;
roomApps=0
}
}I want to take what the user inputs into the text field 'roomName' and use another function addAppliance() to change the innerHTML in the cell to it.
I will also have to access multiple more inputs in other cells so just accessing the last row in the table wouldn't be helpful as far as learning for the rest of the project goes.
if you could offer any help it would be greatly appreciated
full source here:
http://www.filefactory.com/file/a1fgb05/n/Energy_.txt