Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


 
 
LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 06-25-2009, 06:30 AM   #1 (permalink)
Contributing Member
 
Foxtrck's Avatar
 
Join Date: 11-29-06
Location: Scotland, UK
Posts: 201
iTrader: 0 / 0%
Latest Blog:
None

Foxtrck is liked by somebodyFoxtrck is liked by somebodyFoxtrck is liked by somebodyFoxtrck is liked by somebodyFoxtrck is liked by somebody
Send a message via MSN to Foxtrck
Nooby Javascript/PHP Hidden Div Problems

Hi, I'm trying to implement hidden content for a site in php.

PHP looks like this

PHP Code:
            for($i=0$i<$num_rows_publication$i++)
            {
                echo (
"<a href=\"javascript:unhide('content')\">" mysql_result($result_publication$i"pubName") . "</a>");
                                        
                
                
$query_files "SELECT * FROM files WHERE pubId = " 
                
mysql_result($result_publication$i"id") . " ORDER BY files.language";
                        
                        
$result_languages mysql_query($query_files) or die(mysql_error()); 
                        
                        
$num_rows_languages mysql_num_rows($result_languages);
                        
                        for(
$j=0$j<$num_rows_languages;$j++)
                        {                
                            echo(
"<div id='content' class='hidden'>");
                            echo(
"<table>");                        
                            echo(
"<tr><td class='language'><a href='" mysql_result($result_languages$j"file") . "'>" mysql_result($result_languages$j"language") . "</a></td></tr>");
                            echo(
"</table>");
                            echo(
"</div>");
                        }
                        
                echo(
"<hr/>");
            } 
So Ive got a heading and use that as a link to hide/show results from the database.

Javascript fot that is:

<script type="text/javascript">
function unhide(divID) {
var item = document.getElementById(divID);
if (item) {
item.className=(item.className=='hidden')?'unhidde n':'hidden';
}
}
</script>

and two classes hidden/unhidden.

It doesnt really work and im having big problems trying to implement this in the php areas.

Any suggestions?
__________________
http://www.dund.co.uk - DD1 Designs
Foxtrck is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On


Similar Threads
Thread Thread Starter Forum Replies Last Post
noob Having problems with javascript kevin316 Coding Forum 4 06-23-2009 09:18 PM
Encrypt Javascript - Secure Your Javascript Code ZunuZunu Services 7 03-09-2009 01:55 PM
Table and Javascript Problems in IE homebrewpcgaming Coding Forum 3 12-09-2008 03:25 PM
Hidden Div Tag drixie Google Forum 11 03-04-2008 07:47 AM
Count-up from a particular year + Javascript within Javascript? Help! Azam.biz Coding Forum 3 06-06-2005 07:47 AM


Sponsor Links
Get exposure! Contextual Links V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 01:05 AM.
© Copyright 2008 V7 Inc
Powered by vBulletin
Copyright © 2000-2009 Jelsoft Enterprises Limited.


Search Engine Optimization by vBSEO 3.3.0 ©2009, Crawlability, Inc.