I have a page where i add text boxs and such w/ the click of a button.
Example.
[code]
var tbl = document.getElementById(‘tblLines’);
var lastRow = tbl.rows.length;
var iteration = lastRow;
var row = tbl.insertRow(lastRow);
var cell0 = row.insertCell(0)
var cell1 = row.insertCell(1)
inputNode = document.createElement(‘input’);
inputNode.setAttribute(‘type’, ‘text’);
inputNode.setAttribute(‘name’, ‘txtNewShipQty_’ + iteration);
inputNode.setAttribute(‘size’, ‘8’);
inputNode.id = ‘Text10’;
cell1.appendChild(inputNode);
Now the text box and all elements are created just fine and when i sumbit the page i can access the values of these elements w/ asp and write them into a database.
But the issue is when i need to say validate the elemets.
It seems that if i set the name like this
[code]
inputNode.setAttribute(‘name’, ‘txtNewShipQty_’ + iteration);
Then i am unable to access this element w/ javascript again.
BUT
if i set the name ( and for what ever reason the id has to be the same for this to work, if i just set the name and do not set the id to the same name as the id then i will also get a error) like this
[code]
inputNode.name = ‘txtNewShipQty_’ + iteration;
inputNode.id = ‘txtNewShipQty_’ + iteration;
When i say i get an error, i do not get an alert type error, i just get the yellow exlamation point icon in the status bar of the browser.
I just got this working but im looking for an explination on this.
Any ideas?