Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding Elements (sub tables) to a Table..

    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

  • #2
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    use if else? if he ans right then add in the else left it { } ?

  • #3
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    huh?

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

    Thanks
    George

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Last edited by Vladdy; 06-17-2004 at 02:06 PM.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #5
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #7
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks..

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

    George


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •