I can produced a small function using JavaScript, which adds a new table row upon a button click, however, I am unsure how to get values into the dropdown menu. Is it possible to obtain the values from a sql database? Any help would be much appreciated. My existing code can be seen below.
function addRow()
{
//add a row to the rows collection and get a reference to the newly added row
var newRow = document.all("lines").insertRow(-1);
//add 3 cells (<td>) to the new row and set the innerHTML to contain text boxes
var oCell = newRow.insertCell();
oCell.innerHTML = "<input type='button' value='Remove' onclick='removeRow(this);'/>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' name='quantity'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<select name='product' id='product'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' name='barcode'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='checkbox' name='chk'>";
}
Thanks for any help.