...

View Full Version : Adding Elements (sub tables) to a Table..



ggallen
06-16-2004, 08:04 PM
ok. I'm building a test builder.

The initial table will be setup as: (empty)

<TABLE NAME="MAINTABLE">
</TABLE>

I will then want to "add" a question which will effectively add
the below code (not exactly) to the MAINTABLE Table.

<TR>
<TD Width=100%>
<TABLE NAME="QUES"+offset#>
<TR>
<TD WIDTH=50%><TEXTAREA NAME="TEXT"+offset#></TEXTAREA></TD>
<TD WIDTH=10%><SELECT NAME="TYPE"+offset#>...</SELECT></TD>
<TD WIDTH=40%>
<TABLE NAME="INFO+offset#>........</TABLE>
</TD>
</TR>

How would I go about adding complicated elements like the above to
a table using javascript (IE right now, that's the only browser being used).

looking for ideas, not exact code, as what I need added hasn't been
totally finalized yet. Once I get the idea of what I need to do, I should
be ok.

THanks
George

guowei1000
06-17-2004, 02:43 AM
use if else? if he ans right then add in the else left it { } ?

ggallen
06-17-2004, 01:55 PM
huh?

I don't understand that answer at all. Please explain.

Thanks
George

Vladdy
06-17-2004, 02:04 PM
First, I do not see a need for table.
Second, you start with at least one set of elements, then use cloneNode to create a copy of a node containing these elements, modify ids as/if needed, and append to the same parent.

See www.klproductions.com/klquiz.html (find a link to the quiz builder towards the bottom of the page) for interface example.

ggallen
06-17-2004, 02:27 PM
Intresting link..

I'll have to look into cloneNode to see what it/how it works.

I want to have all the questions on the page at one time, so the
table would be a nice way to separate the questions. whereas
the quiz link, only displays one question at a time. And for our
purpose, this are for survey entries, so there are no "correct"
answers, but the setup would be the same as setting up a quiz.

I did find some links with more persistant, and weeding out lots
of sites that didn't help.

Once the questions are setup, I will have a non-js program on
the server side dynamically create the HTML/javascripting needed
for the answering stage.

George

Vladdy
06-17-2004, 02:49 PM
I was not referring to the quiz demo page but to the builder page:
http://www.klproductions.com/klquiz/klquizbuilder.php
I use the described method to add answer options and result ranges.

ggallen
06-17-2004, 03:08 PM
Thanks..

It's going to take awhile to disect, as I don't use these methods.

George



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum