Author |
Topic  |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 10 March 2005 : 05:19:21
|
A simpe question regardin this page. Is it possible to alter the inc_header page to add an onLoad event if a certain page is accessed or would i just need to add the onLoad event and save it as Inc_header_1 and just call upon it when I need it? For instance in pop_profile I call upon inc_header but in this page I would like to include an onload event but I don't want this onLoad event to occur if any other page is being accessed. I am assuming I would just have to include a new inc_header file but if there is a way around this then any help would be appreciative. Thanks!  |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 10 March 2005 : 05:55:38
|
Will you be calling the onload event when using all the various modes of pop_profile.asp or just one particular one? What function will the event be calling?
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 10 March 2005 : 06:40:29
|
Didn't even think about that...it would be just for one (case ""display""). And the function is one I will be creating and is not part of any mod or base code that I am aware of. |
If You Have to Ask, You Wouldn't Understand. |
Edited by - TStewartFan on 10 March 2005 06:43:56 |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 10 March 2005 : 06:45:42
|
Add an if statement to the opening body tag along the lines of:response.write "<body"
if strScriptName="pop_profile.asp" and chkstring(request.querystring("mode"),"display")="xxx" then response.write " onload=""function();"""
response.write ">" This way, if you want to call the function on another page in the future, you just have to modify the if statement.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 10 March 2005 : 06:49:28
|
Sweet i'll give it a go when I return from works. Thanks for the help....and I'll be back...heh |
If You Have to Ask, You Wouldn't Understand. |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 10 March 2005 : 06:53:03
|
You're welcome Lemme know how you get on.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 11 March 2005 : 06:21:45
|
Shagster,
Nothing. I added the if statement to include my two functions I am hoping to add to my profile page but the statement is validating as false. To further prove it was the if statement that was being declared as false I removed my onLoad functions and attempted to change just the background color but that didn't work either. I am assuming the ""xxx"" represents an Any Feature?!? Can you look at the following and see if anything is wrong with this particular if else statement?
"<body" if strScriptName="pop_profile.asp" and chkstring(request.querystring("mode"),"display")="xxx" then Response.Write " bgcolor=""#ffffff"">" Else Response.Write " bgcolor=""#000000"">" End If
There are no errors on the page either.  |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 11 March 2005 : 06:23:28
|
Sorry, should have told you to change xxx to the mode you want to use the onload event for, e.g., display, register, etc..
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 11 March 2005 : 06:34:27
|
Perhaps I am not following you?!? It is going to read display = display?!? Sorry I have not had much practice with playing around with checkstring. Sipping on my coffee and looking at the check string....another question for you. Wouldn't I need to identify the id as well?!? mode = display and id = ??? then ? |
If You Have to Ask, You Wouldn't Understand. |
Edited by - TStewartFan on 11 March 2005 06:40:58 |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 11 March 2005 : 06:44:49
|
It's actually going to read mode="display", the display in the chkstring function is unrelated to the profile mode. You'd only need to check for member id if you wanted the onload event to trigger for one specific member.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 11 March 2005 : 06:57:39
|
I don't understand what you are trying to say...I have tried to alter the statement many ways but it is either false or an invalid statement. I have yet to get it to prove true:
if strScriptName="pop_profile.asp" and chkstring(request.querystring("mode"),"display")="display" then if strScriptName="pop_profile.asp" and chkstring(request.querystring("mode"),"")="display" then if strScriptName="pop_profile.asp" and chkstring(request.querystring("mode"="display")) then if strScriptName="pop_profile.asp" and chkstring(request.querystring("mode")="xxx") then
|
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 11 March 2005 : 07:04:35
|
Ah, I see the problem; I've modified my strScriptName to return just the filename. The first one above should work but you'll need to replace strScriptName="pop_profile.asp" with instr(strScriptName,"pop_profile")>0.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 11 March 2005 : 07:06:43
|
Woohooooooo...thanks a million. You are the man. Not its time to test it with my onLoad functions. |
If You Have to Ask, You Wouldn't Understand. |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 11 March 2005 : 07:16:54
|
You're welcome Apologies for the earlier confusion.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
TStewartFan
Junior Member
 
190 Posts |
Posted - 18 March 2005 : 06:40:10
|
Quick question for you shaggy...does this concept apply for just regular pages as well? For instance I want to apply a simple change to my pop_help.asp page but can't get the effect to take place with the inc_header_short.asp page. Here is what I have for now...will play around with it a bit this evening when I return from work:
if strScriptName="pop_help.asp" then Response.Write "<body bgColor=""" & strPopUpTableColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strVisitedLinkColor & """>" Else Response.Write "<body bgColor=""" & strPageBGColor & """ text=""" & strDefaultFontColor & """ link=""" & strLinkColor & """ aLink=""" & strActiveLinkColor & """ vLink=""" & strVisitedLinkColor & """ onLoad=""window.focus();"">" End If
|
If You Have to Ask, You Wouldn't Understand. |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 18 March 2005 : 06:44:21
|
You've got the condidtions of your if statement the wrong way 'round. The onload event is being triggered on all popups except pop_help.asp.
|
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
|
Topic  |
|