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

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 BUG+FIX 33(.03) members.asp Javascript Error
 Forum Locked  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

PCTech
Starting Member

5 Posts

Posted - 08 November 2001 :  16:23:41  Show Profile
Hello Folks!

Excellent job on them forum!

I get the following javascript error on the members.asp page. I have the page set up so that there are 15 members per page. But, when I click on the drop down link to go to the next list of members, I get this error:

"JavaScript Error:
missing formal parameter.

function ChangePage(int){
....................^

JavaScript Error:
ChangePage is not defined."

Can you please advise of a fix for this javascript error?

Thank you.

PCTech
Edited to include bug report in title - Stim

Edited by - da_stimulator on 08 November 2001 18:57:06

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 November 2001 :  16:27:04  Show Profile
Which browser are you using? Also, which version of that browser.

Example: Internet Explorer v6
Go to Top of Page

PCTech
Starting Member

5 Posts

Posted - 08 November 2001 :  16:29:45  Show Profile
That was FAST!

I am using Netscape Navigator 4.6.

I am also using the 97 database for the forum.

I saw another snitz forum, may have been an older version. It uses links instead of the drop down links. Is is possible to use this older version?

Thanks.

PCTech
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 November 2001 :  16:40:16  Show Profile
The reason for the dropdown boxes being added was when you get a lot of pages, it starts to get messy. Will take a look at it.
Go to Top of Page

PCTech
Starting Member

5 Posts

Posted - 08 November 2001 :  17:02:34  Show Profile
Thank you.

I also emailed a copy of the members.asp file to:

reinhold@bigfoot.com

I advised of the javascript issue here as well.

Thanks for the help. I just need to fix the error so members will stop emailing me about it.

I looked at the file and tried to see where the problem was in the script. But, the script is quite complex and knew the creators would be more familiar with it.

PCTech
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 November 2001 :  17:56:11  Show Profile
Can you check the Members page here and see if you still get the error?

Basically what I did was to change the variable int to fnum

int, I take it is a javascript reserved word.

You can't do a global search and replace because of some instances of cint though.

Line #'s to change int to fnum on:

#43
#44
#470
#484
#489

I don't use Netscape, so I can't test it with that, but I can verify that it works with Opera v5.12
Go to Top of Page

PCTech
Starting Member

5 Posts

Posted - 08 November 2001 :  18:12:16  Show Profile
Thanks!

I tested the members page here and it is working now.

I will update the members.asp file as you suggested.

I use notepad for all my editing, so I do not have a line counter.

Can you email me the members.asp file you corrected to:

mtasker2000@yahoo.com

I'll go insane counting lines in notepad.

Thanks for your quick response and help! This is indeed the most complex forum I have ever seen. The tools available for members is plentiful. They advised they love this forum set-up!

PCTech
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 November 2001 :  18:16:49  Show Profile
I e-mailed the file to you.

It's also available here as well:

http://briefcase.yahoo.com/bc/richard_kinser/lst?&.dir=/bugfix&.src=bc&.view=l&.last=1
Go to Top of Page

PCTech
Starting Member

5 Posts

Posted - 08 November 2001 :  18:24:03  Show Profile
Richard,

Thanks for all your help and the extremely quick responses!

I corrected the file replacing the int with fnum in the 5 areas you described. I also downloaded your file to make sure in case I made a mistake.

It seems this is reserved as you said.

Thanks again for your help.

Do you guys sell this forum? From the forums I have seen, this thing could make a killing.

Thanks for such an awesome freebee! The time you folks put into this does not go unnoticed! Great Job!

PCTech
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 08 November 2001 :  18:47:39  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Richard, what page did you make these changes on? I went through members.asp and found no javascript...

----------
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, and Huw's modified code
Need a Mod? Check out the Mod Resource
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 November 2001 :  19:52:42  Show Profile
The javascript function is right after the includes at the top.

the line #'s are listed a few posts up.
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 08 November 2001 :  21:31:29  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
This is the javascript that is at the header of my members.asp


<script language="JavaScript">
function ChangePage(i){
if (i == 1) {
document.PageNum1.submit();
}
else {
document.PageNum2.submit();
}
}
</script>


Lines 471-501 is as follows:


sub Paging2(int)
if maxpages > 1 then
if Request.QueryString("whichpage") = "" then
sPageNumber = 1
else
sPageNumber = Request.QueryString("whichpage")
end if
if Request.QueryString("method") = "" then
sMethod = "postsdesc"
else
sMethod = Request.QueryString("method")
end if

sScriptName = Request.ServerVariables("script_name")
Response.Write("<form name=""PageNum" & int & """ action=""members.asp"">")
Response.Write("<input type=""hidden"" name=""initial"" value=""" & srchInitial & """>")
Response.Write("<input type=""hidden"" name=""method"" value=""" & sMethod & """>")
Response.Write("<input type=""hidden"" name=""mode"" value=""" & Request("mode") & """>")
Response.Write("<input type=""hidden"" name=""M_NAME"" value=""" & searchName & """>")
Response.Write("<select name=""whichpage"" size=""1"" onchange=""ChangePage(" & int & ");"">")
for counter = 1 to maxpages
if counter <> cint(sPageNumber) then
Response.Write "<OPTION VALUE=""" & counter & """>" & counter
else
Response.Write "<OPTION SELECTED VALUE=""" & counter & """>" & counter
end if
next
Response.Write("</select></form>")

end if
end sub


I changed the sub to match, but since the javascript dosnt match in the first place I didnt change anything. The modified sub is below:


sub Paging2(fnum)
if maxpages > 1 then
if Request.QueryString("whichpage") = "" then
sPageNumber = 1
else
sPageNumber = Request.QueryString("whichpage")
end if
if Request.QueryString("method") = "" then
sMethod = "postsdesc"
else
sMethod = Request.QueryString("method")
end if

sScriptName = Request.ServerVariables("script_name")
Response.Write("<form name=""PageNum" & fnum & """ action=""members.asp"">")
Response.Write("<input type=""hidden"" name=""initial"" value=""" & srchInitial & """>")
Response.Write("<input type=""hidden"" name=""method"" value=""" & sMethod & """>")
Response.Write("<input type=""hidden"" name=""mode"" value=""" & Request("mode") & """>")
Response.Write("<input type=""hidden"" name=""M_NAME"" value=""" & searchName & """>")
Response.Write("<select name=""whichpage"" size=""1"" onchange=""ChangePage(" & fnum & ");"">")
for counter = 1 to maxpages
if counter <> cint(sPageNumber) then
Response.Write "<OPTION VALUE=""" & counter & """>" & counter
else
Response.Write "<OPTION SELECTED VALUE=""" & counter & """>" & counter
end if
next
Response.Write("</select></form>")

end if
end sub


----------
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, and Huw's modified code
Need a Mod? Check out the Mod Resource
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 08 November 2001 :  21:34:38  Show Profile
Here is what the javascript looked like before I modified it:


<script language="JavaScript">
function ChangePage(int){
if (int == 1) {
document.PageNum1.submit();
}
else {
document.PageNum2.submit();
}
}
</script>


and after:


<script language="JavaScript">
function ChangePage(fnum){
if (fnum == 1) {
document.PageNum1.submit();
}
else {
document.PageNum2.submit();
}
}
</script>



btw, the reason I used fnum is short for form number
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 08 November 2001 :  21:44:40  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Ok I updated the javascript for 3.4

----------
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, and Huw's modified code
Need a Mod? Check out the Mod Resource
Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 08 November 2001 :  23:05:26  Show Profile
LoL, Stim the reason the javascript doesn't match with what Richard had is because you already FIXED this bug.
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=16141

And you don't need to change the subroutine. It has nothing to do with the javascript. Int is a reserved word in javascript, not vbscript. There is an Int() function, but without the parenthesis it's just a variable.

- David

Edited by - Davio on 08 November 2001 23:13:13
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 08 November 2001 :  23:14:00  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
LOL... oh man what lack of sleep can do to ya :P thx davio, I was a bit confused there for a bit :) Closing this out

----------
-Eric (da_stimulator)
Stims Snitz Test area - Running 3.3.03, 4 beta, and Huw's modified code
Need a Mod? Check out the Mod Resource
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07