Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > % Ultra Newbie Question %

Reply
Thread Tools

% Ultra Newbie Question %

 
 
Tayna Taylor
Guest
Posts: n/a
 
      11-29-2003
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
 
Reply With Quote
 
 
 
 
Fabian
Guest
Posts: n/a
 
      11-29-2003
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

 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      11-29-2003
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.







 
Reply With Quote
 
Tayna Taylor
Guest
Posts: n/a
 
      11-30-2003
> 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!!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ultra Products Ultra Fire Silverstrand Front Page News 1 06-29-2005 12:29 PM
ihug ultra speed test - ne1 with ultra wanna try this test for me? cowboyz NZ Computing 14 11-25-2004 10:29 PM
Sandisk Ultra II, "new" Ultra, "original " Ultra Eberhard Funke Digital Photography 0 01-13-2004 04:35 PM
Ultra ATA/100 HDD on a Ultra ATA/33 motherboard Prinxce of Darkxness Computer Support 3 01-06-2004 05:36 PM
* Ultra Newbie HTML Question * Julia Briggs HTML 2 11-29-2003 09:27 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57