PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #16  
Old June 30th, 2009, 12:36 PM
IkoTikashi's Avatar
IkoTikashi IkoTikashi is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Sep 2003
Location: Germany
Posts: 1,260 IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level)IkoTikashi User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 11 h 26 m 22 sec
Reputation Power: 275
Quote:
I had considered that, but target is depracated, so was trying to stay away from that if possible...

"target" is deprecated as attribute?
__________________
IkoTikashi - ikotikashi.de

Reply With Quote
  #17  
Old June 30th, 2009, 05:31 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,170 hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 1 Day 28 m 41 sec
Reputation Power: 3255
Quote:
Originally Posted by Onslaught
php Code:
Original - php Code
  1. onclick=\"updateBannerAdd(county); return false;\">".$county3."
should probably be
PHP Code:
 onclick="updateBannerAdd('".$county3."'); return false;\">".$county3.


You have to pass the specific county value to the javascript function, in your current incarnation, county is not set.


I changed to county3 and it still doesn't display anything...

Reply With Quote
  #18  
Old June 30th, 2009, 05:35 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,162 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 5 Days 22 h 39 m 53 sec
Reputation Power: 767
country3 or $country3

Just asking the silly questions just to be sure.

How about alter the updateBannerAdd() function to alert the contents of the variable passed to it.

Reply With Quote
  #19  
Old June 30th, 2009, 05:40 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,170 hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 1 Day 28 m 41 sec
Reputation Power: 3255
Quote:
Originally Posted by Onslaught
country3 or $country3

Just asking the silly questions just to be sure.

How about alter the updateBannerAdd() function to alert the contents of the variable passed to it.


county3 (without the $) ... And you can ask silly questions if you like... as I'm sure you can tell, I'm an idiot with this...

Not sure what you mean about the 2nd part of your response... alert the contents of the variable passed to it...?

Reply With Quote
  #20  
Old June 30th, 2009, 05:45 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,162 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 5 Days 22 h 39 m 53 sec
Reputation Power: 767
javascript Code:
Original - javascript Code
  1. #
  2. function updateBannerAdd(county) {
  3.     alert(county+' is the value passed to updateBannerAdd()');
  4.     $.ajax({
  5.         type: "POST",
  6.         url: "yourbannerloader.php",
  7.         data: "county="+county,
  8.         success: function(msg) {
  9.              $('#bannerDiv').html(msg);
  10.         }
  11.     });
  12. }

When updateBannerAdd is called on your webpage, you should get an alert with the value of county.

About the county3 vs $county3, we are trying to get the contents of the php variable $county3 to be sent to the function. View your source of the completed page, and see what contents are in the specific function calls to make sure your populating that call correctly.
Comments on this post
hiker agrees: Thanks for bearing with me....

Reply With Quote
  #21  
Old June 30th, 2009, 07:20 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,170 hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 1 Day 28 m 41 sec
Reputation Power: 3255
Quote:
Originally Posted by Onslaught
javascript Code:
Original - javascript Code
  1. #
  2. function updateBannerAdd(county) {
  3.     alert(county+' is the value passed to updateBannerAdd()');
  4.     $.ajax({
  5.         type: "POST",
  6.         url: "yourbannerloader.php",
  7.         data: "county="+county,
  8.         success: function(msg) {
  9.              $('#bannerDiv').html(msg);
  10.         }
  11.     });
  12. }

When updateBannerAdd is called on your webpage, you should get an alert with the value of county.

About the county3 vs $county3, we are trying to get the contents of the php variable $county3 to be sent to the function. View your source of the completed page, and see what contents are in the specific function calls to make sure your populating that call correctly.


I tried adding the alert, and nothing happens... it seems as though nothing is happening (except for the menu expanding/collapsing) when the link is clicked...

I viewed the source, and didn't see anything pertinent either... Here's the source:
Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
<title></title>
  <link rel="stylesheet" href="./jquery.treeview.css" />
  <link rel="stylesheet" href="./red-treeview.css" />
	<link rel="stylesheet" href="screen.css" />
  <link rel="stylesheet" href="um.css" type="text/css" />
	
	<script src="./jquery.js" type="text/javascript"></script>
	<script src="./jquery.cookie.js" type="text/javascript"></script>
	<script src="./jquery.treeview.js" type="text/javascript"></script>
	
	<script type="text/javascript">
		$(function() {
			$("#tree").treeview({
				collapsed: true,
				animated: "medium",
				control:"#sidetreecontrol",
				prerendered: true,
				persist: "location"
			});
		})
		
	</script>

<script type="text/javascript">
function updateBannerAdd(county3) {
 alert(county+' is the value passed to updateBannerAdd()');
     $.ajax({
        type: "POST",
        url: "yourbannerloader.php",
        data: "county="+county,
        success: function(msg) {
             $('#bannerDiv').html(msg);
        }
    });
}
</script> 
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> 
<style type="text/css">
*{zoom:1;}
.treeview .hitarea{width:150px;}
</style>
</head>
<body>
<table class="logo">
  <tr>
	  <td>
		Logo and Banner stuff goes here
		</td>
	</tr>
</table>
<table class="nav">
  <tr>
	  <td>
		  <a href="index.php">Home</a> | <a href="contact.php">Contact Us</a> | <a href="about.php">About Us</a> | 
<a href="index2.php?string=<?php print ; ?>">Login / Register</a>		
		</td>
	</tr>
</table>
<table style="width:780px;">
  <tr>
	  <td class="leftcol">
		  Search<br />
			<input type="text" />
		  <a href="#">Advanced</a>
			<hr />
<div id="sidetree">
  <div class="treeheader">&nbsp;</div>
  <div id="sidetreecontrol"> <a href="?#">Collapse All</a> | <a href="?#">Expand All</a> </div>
<ul class="treeview" id="tree"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;"onclick="return false;">Florida</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="updateBannerAdd(county3); return false;">Alachua</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Gainesville</a></div><br /><ul style="display:none;"><li>Item 1</li><li>Item 2</li></ul></li></ul></li></ul><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="updateBannerAdd(county3); return false;">Hillsborough</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Tampa</a></div><br /><ul style="display:none;"><li>Item 4</li></ul></li></ul></li></ul><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="updateBannerAdd(county3); return false;">Marion</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Ocala</a></div><br /><ul style="display:none;"><li>Item 3</li></ul></li></ul></li></ul></li><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;"onclick="return false;">Georgia</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="updateBannerAdd(county3); return false;">Santa Rosa</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Gulf Breeze</a></div><br /><ul style="display:none;"><li>Item 5</li></ul></li></ul></li></ul></li></ul></div>
		</td>
	  <td class="content">
		</td>
		<td class="rightcol">
<div id="bannerDiv"></div>
		</td>
	</tr>
</table>
</body>
</html>

Reply With Quote
  #22  
Old June 30th, 2009, 07:46 PM
simshaun's Avatar
simshaun simshaun is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2008
Location: North Carolina
Posts: 1,732 simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 20455 Folding Title: Starter FolderFolding Points: 20455 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 5 Days 36 m 40 sec
Reputation Power: 1498
Sounds like this is turning into more of a JavaScript issue.

Because you mentioned "nothing happens except for the menu expanding/collapsing when I click the link", I'm pretty sure the problem is due to the fact that the treeview extension is binding a click event to the div.hitarea container, basically eliminating your onclick="" attribute in the link within the hitarea.

First of all, remove the onclick="" attribute and add a rel="" attribute to your anchor. The rel attribute should contain the county name.

Second, change your javascript implementation to match this. Make sure to copy and paste, as I've changed the updateBannerAd function slightly. (This is all untested and probably wont work, but its worth a shot.)
PHP Code:
<script type="text/javascript">
/**
 * Declaration of updateBannerAd function.
 */
function updateBannerAd(county) {
    
alert('County to load is ' county);
    $.
ajax({
        
type"POST",
        
url"yourbannerloader.php",
        
data"county=" county,
        
success: function(msg) {
            $(
'#bannerDiv').html(msg);
        }
    });
}

$(function(){
    $(
"#tree").treeview({
        
collapsedtrue,
        
animated"medium",
        
control:"#sidetreecontrol",
        
prerenderedtrue,
        
persist"location",
        
toggle: function() {
            var 
$ul = $(this);
            
$ul.parent().find(">.hitarea a").click(function(){
                var 
$anchor = $(this);
                
updateBannerAd($anchor.attr('rel')); // Pass the anchor's rel attribute to the function.
            
});
        }
    });
});
</script> 

Last edited by simshaun : June 30th, 2009 at 07:50 PM.

Reply With Quote
  #23  
Old June 30th, 2009, 08:00 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,170 hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 1 Day 28 m 41 sec
Reputation Power: 3255
That made the folder tree into a yo-yo..

Basically if I click to expand, it expands and then collapses right away...

Reply With Quote
  #24  
Old June 30th, 2009, 08:08 PM
simshaun's Avatar
simshaun simshaun is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2008
Location: North Carolina
Posts: 1,732 simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 20455 Folding Title: Starter FolderFolding Points: 20455 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 5 Days 36 m 40 sec
Reputation Power: 1498
It's been a long day and I'm fried, so I expected logic errors.
Try this.
PHP Code:
$(function(){
    $(
"#tree").treeview({
        
collapsedtrue,
        
animated"medium",
        
control:"#sidetreecontrol",
        
prerenderedtrue,
        
persist"location",
        
toggle: function() {
            var 
$ul = $(this);
            if (
$ul.is(":hidden")) {    // This may need to be
                                        // if ($ul.is(":visible"))
                
var $anchor $ul.parent().find(">.hitarea a");
                
updateBannerAd($anchor.attr('rel')); // Pass the anchor's rel attribute to the function.
            
}
        }
    });
}); 
It may still be slightly undesirable. If so, read the comment within the code and make that slight change and see if it helps. It may still not work even after that.. I'm making speculations on certain parts of the treeview code at the moment and I've been coding in front of this screen for 13 hours working.

Edit: Heading home now, so will get back with ya tomorrow.
Comments on this post
hiker agrees: Thanks for bearing with me....

Last edited by simshaun : June 30th, 2009 at 08:16 PM.

Reply With Quote
  #25  
Old June 30th, 2009, 08:45 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,170 hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 1 Day 28 m 41 sec
Reputation Power: 3255
Alright.. so the code that I mentioned doing the yo yo effect was actually my error... I didnt realize you had incorporated the treeview function as well.. so I commented that out and tried.... still didn't do anything... but wasn't opening and closing anymore.

So the code from your last post didn't work as posted... I did try changing hidden to visible and the outcome was:
1) When I clicked on state to expand, it popped up 3 alert boxes, one after another, all saying "County to load is undefined"
2) When I clicked either county or city, it popped up 1 alert box saying the same.

I then tried changing county to county3, and instead of any popups, nothing beyond the county would drop down.

Thanks again for all the help thusfar...

Reply With Quote
  #26  
Old July 1st, 2009, 10:01 AM
simshaun's Avatar
simshaun simshaun is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2008
Location: North Carolina
Posts: 1,732 simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)simshaun User rank is General 8th Grade (Above 100000 Reputation Level)  Folding Points: 20455 Folding Title: Starter FolderFolding Points: 20455 Folding Title: Starter Folder
Time spent in forums: 2 Weeks 5 Days 36 m 40 sec
Reputation Power: 1498
I don't suppose you could re-post the generated html that you have now (everything minus the php). This is something I'll have to play around with to get to work.

Reply With Quote
  #27  
Old July 1st, 2009, 10:15 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,162 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 5 Days 22 h 39 m 53 sec
Reputation Power: 767
ok, first there is a big problem we have to solve, and that is your still not populating the argument to pass to the updateBannerAdd() function call.

simshaun did a nice rework of the function so that it looks at the rel instead of waiting for the function call itself, so the question changes a bit, but still overall is the same. Are you populating the rel of the county anchor tab?

Once we get a valid argument being passed into the function, we can easily do away with the unwanted alerts with a simple check against the incoming argument. But until we get to that point, it's better to leave the alert in there.

From your last php code posted, updated to reflect our current direction:
PHP Code:
if (mysql_num_rows($result) != '0') {
  while(
$row mysql_fetch_array($result)) {
      
$string5$row['string'];
      
$state3 $row['state'];
      
$county3 $row['county'];
      
$city3 $row['city'];
        
$item3 $row['item_name'];
        if (
$state2 != $state3) {
            if (
$i != 1) {
            
$treeview .= "</ul></li></ul></li></ul></li>";            
          }
          
$i++;
            
$treeview .= "<li class=\"expandable\"><div class=\"hitarea expandable-hitarea\"><a href=\"#\" style=\"margin-left:20px;\"onclick=\"return false;\">".$state3."</a></div><br />";
            
$state2 $state3;
            
$j 1;
        }
      if (
$county2 != $county3) {
            if (
$j != 1) {
            
$treeview .= "</ul></li></ul></li></ul>";            
          }
          
$j++;
          
$treeview .= "<ul style=\"display:none;\">";
          
$treeview .= "<li class=\"expandable\"><div class=\"hitarea expandable-hitarea\"><a href=\"#\" style=\"margin-left:20px;\" rel=\"".$county3."\" onclick=\"return false;\">".$county3."</a></div><br />";
          
$county2 $county3;
        }
        if (
$city2 != $city3) {
      
$treeview .= "<ul style=\"display:none;\">";
          
$treeview .= "<li class=\"expandable\"><div class=\"hitarea expandable-hitarea\"><a href=\"#\" style=\"margin-left:20px;\" onclick=\"return false;\">".$city3."</a></div><br />";
            
$city2 $city3;
      
$treeview .= "<ul style=\"display:none;\">";        
        }
        if (
$item3) {
//          $treeview .= "<li><a href=\"index.php\">".$item3."</a></li><br />";
          
$treeview .= "<li>".$item3."</li>";
            
$item2 $item3;
        }
    } 
}
$treeview .= "</ul></li></ul></li></ul></li></ul>"
If you notice, I'm actually setting the rel attribute of the anchor tag with the $county3 php variable.

Reply With Quote
  #28  
Old July 1st, 2009, 03:34 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,170 hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 1 Day 28 m 41 sec
Reputation Power: 3255
Quote:
Originally Posted by simshaun
I don't suppose you could re-post the generated html that you have now (everything minus the php). This is something I'll have to play around with to get to work.


Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head>
<title>Uncommon Marketplace</title>
  <link rel="stylesheet" href="./jquery.treeview.css" />
  <link rel="stylesheet" href="./red-treeview.css" />
	<link rel="stylesheet" href="screen.css" />
  <link rel="stylesheet" href="um.css" type="text/css" />
	
	<script src="./jquery.js" type="text/javascript"></script>
	<script src="./jquery.cookie.js" type="text/javascript"></script>
	<script src="./jquery.treeview.js" type="text/javascript"></script>

<!--	
	<script type="text/javascript">
		$(function() {
			$("#tree").treeview({
				collapsed: true,
				animated: "medium",
				control:"#sidetreecontrol",
				prerendered: true,
				persist: "location"
			});
		})
		
	</script>
-->
<script type="text/javascript">
/**
 * Declaration of updateBannerAd function.
 */
function updateBannerAd(county) {
    alert('County to load is ' + county);
    $.ajax({
        type: "POST",
        url: "yourbannerloader.php",
        data: "county=" + county,
        success: function(msg) {
            $('#bannerDiv').html(msg);
        }
    });
}

$(function(){
    $("#tree").treeview({
        collapsed: true,
        animated: "medium",
        control:"#sidetreecontrol",
        prerendered: true,
        persist: "location",
        toggle: function() {
            var $ul = $(this);
            if ($ul.is(":visible")) {    // This may need to be
                                        // if ($ul.is(":visible"))
                var $anchor = $ul.parent().find(">.hitarea a");
                updateBannerAd($anchor.attr('rel')); // Pass the anchor's rel attribute to the function.
            }
        }
    });
});  
</script>  
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> 
<style type="text/css">
*{zoom:1;}
.treeview .hitarea{width:150px;}
</style>
</head>
<body>
<table class="logo">
  <tr>
	  <td>
		Logo and Banner stuff goes here
		</td>
	</tr>
</table>
<table class="nav">
  <tr>
	  <td>
		  <a href="index.php">Home</a> | <a href="contact.php">Contact Us</a> | <a href="about.php">About Us</a> | 
<a href="index2.php?string=<?php print ; ?>">Login / Register</a>		
		</td>
	</tr>
</table>
<table style="width:780px;">
  <tr>
	  <td class="leftcol">
		  Search<br />
			<input type="text" />
		  <a href="#">Advanced</a>
			<hr />
<div id="sidetree">
  <div class="treeheader">&nbsp;</div>
  <div id="sidetreecontrol"> <a href="?#">Collapse All</a> | <a href="?#">Expand All</a> </div>
<ul class="treeview" id="tree"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Florida</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" rel="Alachua" onclick="return false;">Alachua</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Gainesville</a></div><br /><ul style="display:none;"><li>Item 1</li><li>Item 2</li></ul></li></ul></li></ul><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" rel="Hillsborough" onclick="return false;">Hillsborough</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Tampa</a></div><br /><ul style="display:none;"><li>Item 4</li></ul></li></ul></li></ul><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" rel="Marion" onclick="return false;">Marion</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Ocala</a></div><br /><ul style="display:none;"><li>Item 3</li></ul></li></ul></li></ul></li><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Georgia</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" rel="Santa Rosa" onclick="return false;">Santa Rosa</a></div><br /><ul style="display:none;"><li class="expandable"><div class="hitarea expandable-hitarea"><a href="#" style="margin-left:20px;" onclick="return false;">Gulf Breeze</a></div><br /><ul style="display:none;"><li>Item 5</li></ul></li></ul></li></ul></li></ul></div>
		</td>
	  <td class="content">
		</td>
		<td class="rightcol">
<div id="bannerDiv"></div>
		</td>
	</tr>
</table>
</body>
</html>


@Onslaught: For the rel tag, I have it with the $ as well.... looks just like what you posted....

So far it seems I'm following along...

Thanks again..

Reply With Quote
  #29  
Old July 1st, 2009, 03:38 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,162 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 5 Days 22 h 39 m 53 sec
Reputation Power: 767
is the alerts coming up with a valid county now?

Reply With Quote
  #30  
Old July 1st, 2009, 03:47 PM
hiker's Avatar
hiker hiker is offline
They're coming to take me away
Click here for more information
 
Join Date: Jan 2005
Location: Florida
Posts: 4,170 hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)hiker User rank is General 34th Grade (Above 100000 Reputation Level)  Folding Points: 33832 Folding Title: Starter FolderFolding Points: 33832 Folding Title: Starter Folder
Time spent in forums: 2 Months 2 Weeks 1 Day 28 m 41 sec
Reputation Power: 3255
Quote:
Originally Posted by Onslaught
is the alerts coming up with a valid county now?


No... The rel=$county declaration is how I had it yesterday... the alert says undefined...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - $_GET using an iframe


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek