Haseldow
05-07-2003, 02:22 AM
Hi,
I can't seem to get table tags to work in my dynamic input form webpage.
The basic idea. You have 5 rows with 10 columns to where you enter all sorts of data. If someone wants to add more details (regarding the row that is being filled), there's a dropdown box where you can add 10 columns wide text field. The text field should appear below the row you are filling. The dropdown box is there because if I get this to work, it will add an amount of extra rows equal to the number selected from the dropdown box.
It doesen't matter if you didn't understand the above. Here's the problem.
...blaah blaah...
function SelectChange1(form)
{
lsr="<";
gtr=">";
<!-- the problem is propably in the line below -->
data=lsr+"TR"+gtr+lsr+"TD COLSPAN=10"+gtr+lsr+"INPUT TYPE='text' NAME='more'"+gtr+lsr+"/TD"+gtr+lsr+"/TR"+gtr;
if (document.layers)
{
document.layers.cust1.document.write(data);
document.layers.cust1.document.close();
}
else
{
if (document.all)
{
cust1.innerHTML=data;
}
}
}
...blaah blaah...
<TABLE BORDER=0>
<!-- the below row is repeated 5 times -->
<TR><TD>
<INPUT TYPE='text' NAME='firstname_row_1'>
...blaah (8 more text fields to fill) blaah...
<SELECT NAME='add_lines_1' OnChange='javascript:SelectChange1(this.form);' VALUE='option'>
<OPTION VALUE=0>0</OPTION>
<OPTION VALUE=1>1</OPTION>
</SELECT>
</TD></TR>
<SPAN ID=cust1 STYLE="position:relative;"></SPAN>
<!-- this x5 as I mentioned earlier -->
</TABLE>
So now when I select 1 from the dropdown box, nothing happens. If I remove every <TR>, <TD>, </TD> and </TR> tags, the textfield does appear. So has anyone got an idea of how can I generate more rows to a table?
Regards,
-Haseldow
Ps. If you didn't get a grip of this example, please ask more details as this may be quite confusing :)
I can't seem to get table tags to work in my dynamic input form webpage.
The basic idea. You have 5 rows with 10 columns to where you enter all sorts of data. If someone wants to add more details (regarding the row that is being filled), there's a dropdown box where you can add 10 columns wide text field. The text field should appear below the row you are filling. The dropdown box is there because if I get this to work, it will add an amount of extra rows equal to the number selected from the dropdown box.
It doesen't matter if you didn't understand the above. Here's the problem.
...blaah blaah...
function SelectChange1(form)
{
lsr="<";
gtr=">";
<!-- the problem is propably in the line below -->
data=lsr+"TR"+gtr+lsr+"TD COLSPAN=10"+gtr+lsr+"INPUT TYPE='text' NAME='more'"+gtr+lsr+"/TD"+gtr+lsr+"/TR"+gtr;
if (document.layers)
{
document.layers.cust1.document.write(data);
document.layers.cust1.document.close();
}
else
{
if (document.all)
{
cust1.innerHTML=data;
}
}
}
...blaah blaah...
<TABLE BORDER=0>
<!-- the below row is repeated 5 times -->
<TR><TD>
<INPUT TYPE='text' NAME='firstname_row_1'>
...blaah (8 more text fields to fill) blaah...
<SELECT NAME='add_lines_1' OnChange='javascript:SelectChange1(this.form);' VALUE='option'>
<OPTION VALUE=0>0</OPTION>
<OPTION VALUE=1>1</OPTION>
</SELECT>
</TD></TR>
<SPAN ID=cust1 STYLE="position:relative;"></SPAN>
<!-- this x5 as I mentioned earlier -->
</TABLE>
So now when I select 1 from the dropdown box, nothing happens. If I remove every <TR>, <TD>, </TD> and </TR> tags, the textfield does appear. So has anyone got an idea of how can I generate more rows to a table?
Regards,
-Haseldow
Ps. If you didn't get a grip of this example, please ask more details as this may be quite confusing :)