Build Form OTF (on the fly)

Giganews Newsgroups
Subject: Build Form OTF (on the fly)
Posted by:  millhouā€¦@mountaincable.net (Dave)
Date: 10 Jul 2003

After much general searching, a JS newbie asks: can anyone point me to
where I can find out how to build a page (including form) using
Javascript? The reason I'd want to do this is because the page html is
becoming quite large due to form element attributes for each row of a
large form. I'm under the impression that I could condense this by
assigning variables to blocks of text that make up the page elements
and using script to write these elements to the window. Not only that,
but if I want to modify an attribute, I currently have to do it 25x
just for one column of the form. Being able to only modify a variable
once would propagate the change to the entire colum at least. Here's
an example of the length of just one table data tag (there are 5
similar tags per row):

<td width="72" align="center" height="22"><input type="text" READONLY
name="Item3" size="9" value="AS2K" style="height-style: 15;
text-align: Right; font-size: 8"></td>

I'm thinking that blocks of html such as everything in the above from
"<td" to "value=" could be one variable, and the "style=...8"> could
be another.
Would building the page using script be leaner?
Thanks,
Dave

Replies