Author |
Topic |
PCTech
Starting Member
5 Posts |
Posted - 08 November 2001 : 16:23:41
|
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
|
Which browser are you using? Also, which version of that browser.
Example: Internet Explorer v6
|
|
|
PCTech
Starting Member
5 Posts |
Posted - 08 November 2001 : 16:29:45
|
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 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 08 November 2001 : 16:40:16
|
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. |
|
|
PCTech
Starting Member
5 Posts |
Posted - 08 November 2001 : 17:02:34
|
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 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 08 November 2001 : 17:56:11
|
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 |
|
|
PCTech
Starting Member
5 Posts |
Posted - 08 November 2001 : 18:12:16
|
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 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
|
PCTech
Starting Member
5 Posts |
Posted - 08 November 2001 : 18:24:03
|
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 |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 08 November 2001 : 18:47:39
|
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 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 08 November 2001 : 19:52:42
|
The javascript function is right after the includes at the top.
the line #'s are listed a few posts up. |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 08 November 2001 : 21:31:29
|
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 |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 08 November 2001 : 21:34:38
|
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 |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 08 November 2001 : 21:44:40
|
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 |
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 08 November 2001 : 23:05:26
|
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 |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 08 November 2001 : 23:14:00
|
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 |
|
|
Topic |
|