yarik
06-11-2003, 03:11 AM
Hi everyone!
i am very new to Java Script and HTML
could someone tell me please is it the right syntax ?
The problem that i am having with this script: the location of the dynamic fields that are created.
it seems to me that something wrong with this line: '<tr><td ALIGN=RIGHT>'+'<input size=10 maxlength=9 value="'+[i]+'" name="Breakpoint"></td></tr><BR>'
I think that trs and tds are not created because the field is created in the very left of this form
function addNewField(){
var sHTML = ""
//sHTML = '<table>'
//write previous fields with data from array
for(i=0; i<totalRows; i++)
sHTML+='<tr><td ALIGN=RIGHT>'+'<input size=10 maxlength=9 value="'+[i]+'" name="Breakpoint"></td></tr><BR>'
//add empty (new) field
sHTML+='<tr><td<td ALIGN=RIGHT>'+'<input value="" size=10 maxlength=9 name="Breakpoint"></td></tr><br>'
//sHTML +='</table>'
totalRows = totalRows + 1;
//displays HTML in the <DIV id="content"></DIV> container
document.all.content.innerHTML = sHTML
}
i am very new to Java Script and HTML
could someone tell me please is it the right syntax ?
The problem that i am having with this script: the location of the dynamic fields that are created.
it seems to me that something wrong with this line: '<tr><td ALIGN=RIGHT>'+'<input size=10 maxlength=9 value="'+[i]+'" name="Breakpoint"></td></tr><BR>'
I think that trs and tds are not created because the field is created in the very left of this form
function addNewField(){
var sHTML = ""
//sHTML = '<table>'
//write previous fields with data from array
for(i=0; i<totalRows; i++)
sHTML+='<tr><td ALIGN=RIGHT>'+'<input size=10 maxlength=9 value="'+[i]+'" name="Breakpoint"></td></tr><BR>'
//add empty (new) field
sHTML+='<tr><td<td ALIGN=RIGHT>'+'<input value="" size=10 maxlength=9 name="Breakpoint"></td></tr><br>'
//sHTML +='</table>'
totalRows = totalRows + 1;
//displays HTML in the <DIV id="content"></DIV> container
document.all.content.innerHTML = sHTML
}