% Ultra Newbie Question %

Discussion in 'Javascript' started by Tayna Taylor, Nov 29, 2003.

  1. Tayna Taylor

    Tayna Taylor Guest

    Ok, here goes -- I don't know if this is too complex to figure out,
    but let's give it a shot! :)

    I have a SQL loop around a bunch of HTML code:

    ///*START SQL LOOP*

    <html>
    PHP, graphics, code & stuff
    </html>

    ///*END SQL LOOP*


    So, ok this runs and spits out however many result sets (sections) on
    the screen. Fine so okay, it works -- but here is the clincher & what
    I want to do --

    Each HTML result set has two tabs... if someone clicks on a tab it
    shows different data in the HTML result set -- so what I want to do
    for elegance rather than having the screen refresh is to use some kind
    of DHTML <div> technique to statelessly go between each screen in each
    section when a user clicks back and forth on a tab.

    So below is something I was thinking about how in theory it could
    work, but I don't know how I would implement it...


    ///*START SQL LOOP*


    //(I want this displayed initially)

    <div ID="StateOne">
    <html>
    PHP, SQL, graphics, other code & stuff
    </html>
    </div>

    //(I want this displayed when a tab two <a href> button is clicked)

    <div ID="StateTwo">
    <html>
    PHP, SQL, graphics, other code & stuff
    </html>
    </div>

    ///*END SQL LOOP*


    (FYI - above you can assume that the database has already been queried
    before this, so the entire dataset needed is all ready to plug in
    wherever its needed)


    I've seen various techniques on how you can change stuff on the screen
    using <div> tags and javascript - but the SQL loop around this,
    compounded by the fact that there may be more than one of these at any
    given time seems to make this a very difficult boggle for me.


    If anyone can solve this I will be so so so happy, because my life as
    a developer seems to now depend on it!!!!

    Sincerely,

    Tayna Taylor
     
    Tayna Taylor, Nov 29, 2003
    #1
    1. Advertising

  2. Tayna Taylor

    Fabian Guest

    Tayna Taylor hu kiteb:


    > //(I want this displayed initially)
    >
    > <div ID="StateOne">
    > <html>
    > PHP, SQL, graphics, other code & stuff
    > </html>
    > </div>



    eek! Stop right there. HTML tags cannot appear inside anything
    whatsoever. they are the top level.

    In basic terms, you want each DIV to have a unique ID, set all but one
    to visibiloity:hidden at start, and have the tabs (outside all the divs)
    set visibility tags appropriately.


    --
    --
    Fabian
    Visit my website often and for long periods!
    http://www.lajzar.co.uk
     
    Fabian, Nov 29, 2003
    #2
    1. Advertising

  3. Tayna Taylor

    VK Guest

    You did not tell this explicitly, but I presume that you are using some
    "on-fly" page generation technique, must be ASP (No PHP or JSP, I think,
    otherwise you would not be so humble in your request :)

    The important question to answer is how much do you care of losers
    (wanna-bes, future destroyers of the M$ Empire of the Evil, you name
    it).
    More of them you want to include in your solution, more complicated the
    solution will be.

    Let's say you care only of the current winner (IE) and Netscape (for the
    traditional respect to its former glory). That would cover about 97% of
    your customers. If it sounds OK to you then:

    1. Customer's calling your page with yourpage.asp?blah-blah-blah

    2. Your are generating two (three, four, five) data sets for this
    request and put them in <div></div> within the same <html> page.

    3. For each div you are making a tab top to switch from one tab (div) to
    another.
    The basic technique is
    document.divID.style.visibility = "visible"
    document.divID.style.visibility = "hidden"
    But to save your time, just go to www.dynamicdrive.com, they have a
    bunch of interfaces of this kind.

    If you make another dare step to work with IE users only (which will
    drop your coverage to about 91%), I would suggest to look at Microsoft
    Data Island technique. Does all the same, but with tons of time saved.
     
    VK, Nov 29, 2003
    #3
  4. Tayna Taylor

    Tayna Taylor Guest

    > eek! Stop right there. HTML tags cannot appear inside anything
    > whatsoever. they are the top level.


    Double EEP! Sorry! All of those <html> tags are supposed to be <table> tags!!
     
    Tayna Taylor, Nov 30, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julia Briggs

    * Ultra Newbie HTML Question *

    Julia Briggs, Nov 29, 2003, in forum: HTML
    Replies:
    2
    Views:
    372
    Spartanicus
    Nov 29, 2003
  2. John Salerno

    ultra newbie question (don't laugh)

    John Salerno, Sep 26, 2006, in forum: Python
    Replies:
    7
    Views:
    273
    Peter Otten
    Sep 26, 2006
  3. Tayna Taylor
    Replies:
    1
    Views:
    100
  4. Leodiensian
    Replies:
    0
    Views:
    78
    Leodiensian
    Apr 15, 2004
  5. Julia Briggs
    Replies:
    6
    Views:
    121
    Ben Morrow
    Jan 19, 2004
Loading...

Share This Page