Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Inc_header.asp question
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

TStewartFan
Junior Member

190 Posts

Posted - 10 March 2005 :  05:19:21  Show Profile  Visit TStewartFan's Homepage
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  Show Profile
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.”
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 10 March 2005 :  06:40:29  Show Profile  Visit TStewartFan's Homepage
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
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 10 March 2005 :  06:45:42  Show Profile
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.”
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 10 March 2005 :  06:49:28  Show Profile  Visit TStewartFan's Homepage
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.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 10 March 2005 :  06:53:03  Show Profile
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.”
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 11 March 2005 :  06:21:45  Show Profile  Visit TStewartFan's Homepage
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.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 March 2005 :  06:23:28  Show Profile
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.”
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 11 March 2005 :  06:34:27  Show Profile  Visit TStewartFan's Homepage
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
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 March 2005 :  06:44:49  Show Profile
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.”
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 11 March 2005 :  06:57:39  Show Profile  Visit TStewartFan's Homepage
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
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 March 2005 :  07:04:35  Show Profile
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.”
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 11 March 2005 :  07:06:43  Show Profile  Visit TStewartFan's Homepage
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.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 March 2005 :  07:16:54  Show Profile
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.”
Go to Top of Page

TStewartFan
Junior Member

190 Posts

Posted - 18 March 2005 :  06:40:10  Show Profile  Visit TStewartFan's Homepage
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.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 18 March 2005 :  06:44:21  Show Profile
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.”
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.64 seconds. Powered By: Snitz Forums 2000 Version 3.4.07