|
-
Dec 13th, 2001, 11:57 AM
#1
Thread Starter
Lively Member
Javascript error in netscape
//******************************************************************
//*Function verify
//*This function checks to see if fields are filled out properly.
//*Imports: form name
//*Exports: returns true if the form is filled out properly,
//* false otherwise.
//******************************************************************/
function verify(search){
//checks to see if Keyword is filled out.
if(search.keyword.value==""){
alert("Please enter a keyword.");
search.keyword.focus();
return false;
}
else return true;
}
// This function sets the focus so the user can input easily.
function set_focus(){
search.keyword.focus();
}
Can anyone see the problem?
Don't ever Ginop before you Ginip 
-
Dec 13th, 2001, 12:01 PM
#2
Frenzied Member
1) Use vBulletin code tags
2) What is being passed to verify()?
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Dec 13th, 2001, 12:03 PM
#3
Thread Starter
Lively Member
ciberthug
1)what is vBulliten?
2)Do you think this could have an effect on the ASP post that i had earlier?(still trying to figure it out)
this is the page that is sending the info to the ASP
Don't ever Ginop before you Ginip 
-
Dec 13th, 2001, 12:10 PM
#4
Hyperactive Member
I'm assuming 'search' is the name of your form
try
Code:
document.search.keyword.value == " "
-
Dec 13th, 2001, 12:11 PM
#5
Frenzied Member
vBulletin is the engine behind this Web BBS. You can wrap code in special tags so they will be presented in a TT font and preserve your indention.
Code:
So you can
correctly align
all you little bits
of code
I haven't a clue about your ASP problem from earlier. See if you can wash that problem and this problem down to its simpliest form. Pinpoint what exactly is causing the problem.
As to this piece of JavaScript. Unless I see what is being passed to verify(), I haven't a clue what you are trying to do.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Dec 13th, 2001, 12:14 PM
#6
Thread Starter
Lively Member
actually this page is set in a frame so it could also be something in here:
<script language="Javascript" type="text/javascript">
<!-- Begin
var url1024 = "index_netscape.htm";
sWidth = 0
sHeight = 0
sWidth = java.awt.Toolkit.getDefaultToolkit().getScreenSize().width
sHeight = java.awt.Toolkit.getDefaultToolkit().getScreenSize().height
if(sWidth == 1027 || sHeight == 768)
{
window.location.href = url1024;
}
//End-->
</script>
Don't ever Ginop before you Ginip 
-
Dec 13th, 2001, 12:15 PM
#7
Frenzied Member
Originally posted by progressive
Code:
document.search.keyword.value == " "
Shhhh... I think you are right, but I don't think he knows what he's doing.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Dec 13th, 2001, 12:16 PM
#8
Hyperactive Member
the last thing he posted must be a new version of javascript ! called JAVA
-
Dec 13th, 2001, 12:19 PM
#9
Hyperactive Member
Crazy_bee:
Did you actually write these scripts, or a you modifying them?
Don't just post your code in dribs and drabs, if you want a solution we need the big picture!!
-
Dec 13th, 2001, 01:18 PM
#10
Thread Starter
Lively Member
Your right I am just modifying. Tell me what you need to see.
Don't ever Ginop before you Ginip 
-
Dec 13th, 2001, 01:23 PM
#11
Thread Starter
Lively Member
this is the whole page that has the error. this page takes what is submitted and passes it to an .asp. this all works fine in IE but not at all in netscape:
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
//******************************************************************
//*Function verify
//*This function checks to see if fields are filled out properly.
//*Imports: form name
//*Exports: returns true if the form is filled out properly,
//* false otherwise.
//******************************************************************/
function verify(search){
//checks to see if Keyword is filled out.
if(search.keyword.value == ""){
alert("Please enter a keyword.");
search.keyword.focus();
return false;
}
else return true;
}
// This function sets the focus so the user can input easily.
function set_focus(){
search.keyword.focus();
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#089494" VLINK="#089494" ALINK="#089494" ONLOAD="set_focus();">
<CENTER>
<H2>TSG Address Search</H2>
<FORM NAME="search" ACTION="Address Search Results.asp" METHOD="POST" ONSUBMIT="return verify (search);">
<TABLE BORDER="2">
<TR>
<TD>
<TABLE BORDER="0" BGCOLOR="#089494">
<TR>
<TD><B>Select geographic area:</B></TD>
<TD>
<SELECT NAME="location" SIZE="1">
<OPTION NAME="Alabama">Alabama
<OPTION NAME="Arizona">Arizona
<OPTION NAME="California_Pac_Bell">California_Pac_Bell
<OPTION NAME="Cincinnati_Bell">Cincinnati_Bell
<OPTION NAME="Colorado">Colorado
<OPTION NAME="Connecticut">Connecticut
<OPTION NAME="Florida Bell South">Florida_Bell_South
<OPTION NAME="Georgia Bell South">Georgia_Bell_South
<OPTION NAME="Illinois">Illinois
<OPTION NAME="Indiana">Indiana
<OPTION NAME="IRVINE CA {GTE}">Irvine_Ca_GTE
<OPTION NAME="Kansas">Kansas
<OPTION NAME="Kentucky">Kentucky
<OPTION NAME="Los_Angeles_CA">Los_Angeles_Ca_GTE
<OPTION NAME="Maryland">Maryland
<OPTION NAME="Massachusetts">Massachusetts
<OPTION NAME="Michigan">Michigan
<OPTION NAME="Minnesota">Minnesota
<OPTION NAME="Missouri">Missouri
<OPTION NAME="NEW_HAMPSHIRE">New_Hampshire
<OPTION NAME="New_Jersey">New_Jersey
<OPTION NAME="New_York">New_York
<OPTION NAME="New_Orleans_LA">New_Orleans_LA
<OPTION NAME="North_Carolina">North_Carolina
<OPTION NAME="Ohio">Ohio
<OPTION NAME="Oregon">Oregon
<OPTION NAME="Philadelphia">Philadelphia
<OPTION NAME="Pittsburgh">Pittsburgh
<OPTION NAME="San_Diego_Ca">San_Diego_CA_GTE
<OPTION NAME="Tampa_FL">Tampa_FL_GTE
<OPTION NAME="Tennessee">Tennessee
<OPTION NAME="Texas">Texas
<OPTION NAME="Texas_GTE">Texas_GTE
<OPTION NAME="Utah">Utah
<OPTION NAME="Virginia">Virginia
<OPTION NAME="Washington_State">Washington_State
<OPTION NAME="Washington_DC">Washington_DC
<OPTION NAME="Wisconsin">Wisconsin
</SELECT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<BR>
<TABLE BORDER="5">
<TR>
<TD>
<TABLE BORDER="0" BGCOLOR="#089494">
<TR>
<TD></TD>
<TD ALIGN="right"><B>Topic</B></TD>
<TD ALIGN="right"><B>Keyword</B></TD>
</TR>
<TR>
<TD><B>Select first search criteria:</B></TD>
<TD>
<SELECT NAME="topic" SIZE="1" ALIGN="right">
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" NAME="keyword"></TD>
</TR>
<TR>
<TD><B>Select second search criteria (optional):</B></TD>
<TD>
<SELECT NAME="topic2" SIZE="1">
<OPTION NAME="(Optional)">(Optional)
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" VALUE="(Optional)" NAME="keyword2"></TD>
</TR>
<TR>
<TD><B>Select third search criteria (optional):</B></TD>
<TD>
<SELECT NAME="topic3" SIZE="1">
<OPTION NAME="(Optional)">(Optional)
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" VALUE="(Optional)" NAME="keyword3"></INPUT></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE BORDER="0">
<TR>
<TD><INPUT TYPE="Submit" VALUE="Search The Database"></TD>
<TD><INPUT TYPE="Reset" VALUE="Reset"></TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
Don't ever Ginop before you Ginip 
-
Dec 13th, 2001, 01:36 PM
#12
Frenzied Member

Code:
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
//******************************************************************
//*Function verify
//*This function checks to see if fields are filled out properly.
//*Imports: form name
//*Exports: returns true if the form is filled out properly,
//* false otherwise.
//******************************************************************/
function verify(search){
//checks to see if Keyword is filled out.
if(search.keyword.value == ""){
alert("Please enter a keyword.");
search.keyword.focus();
return false;
}
else return true;
}
// This function sets the focus so the user can input easily.
function set_focus(){
search.keyword.focus();
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#089494" VLINK="#089494" ALINK="#089494" ONLOAD="set_focus();">
<CENTER>
<H2>TSG Address Search</H2>
<FORM NAME="search" ACTION="Address Search Results.asp" METHOD="POST" ONSUBMIT="return verify (search);">
<TABLE BORDER="2">
<TR>
<TD>
<TABLE BORDER="0" BGCOLOR="#089494">
<TR>
<TD><B>Select geographic area:</B></TD>
<TD>
<SELECT NAME="location" SIZE="1">
<OPTION NAME="Alabama">Alabama
<OPTION NAME="Arizona">Arizona
<OPTION NAME="California_Pac_Bell">California_Pac_Bell
<OPTION NAME="Cincinnati_Bell">Cincinnati_Bell
<OPTION NAME="Colorado">Colorado
<OPTION NAME="Connecticut">Connecticut
<OPTION NAME="Florida Bell South">Florida_Bell_South
<OPTION NAME="Georgia Bell South">Georgia_Bell_South
<OPTION NAME="Illinois">Illinois
<OPTION NAME="Indiana">Indiana
<OPTION NAME="IRVINE CA {GTE}">Irvine_Ca_GTE
<OPTION NAME="Kansas">Kansas
<OPTION NAME="Kentucky">Kentucky
<OPTION NAME="Los_Angeles_CA">Los_Angeles_Ca_GTE
<OPTION NAME="Maryland">Maryland
<OPTION NAME="Massachusetts">Massachusetts
<OPTION NAME="Michigan">Michigan
<OPTION NAME="Minnesota">Minnesota
<OPTION NAME="Missouri">Missouri
<OPTION NAME="NEW_HAMPSHIRE">New_Hampshire
<OPTION NAME="New_Jersey">New_Jersey
<OPTION NAME="New_York">New_York
<OPTION NAME="New_Orleans_LA">New_Orleans_LA
<OPTION NAME="North_Carolina">North_Carolina
<OPTION NAME="Ohio">Ohio
<OPTION NAME="Oregon">Oregon
<OPTION NAME="Philadelphia">Philadelphia
<OPTION NAME="Pittsburgh">Pittsburgh
<OPTION NAME="San_Diego_Ca">San_Diego_CA_GTE
<OPTION NAME="Tampa_FL">Tampa_FL_GTE
<OPTION NAME="Tennessee">Tennessee
<OPTION NAME="Texas">Texas
<OPTION NAME="Texas_GTE">Texas_GTE
<OPTION NAME="Utah">Utah
<OPTION NAME="Virginia">Virginia
<OPTION NAME="Washington_State">Washington_State
<OPTION NAME="Washington_DC">Washington_DC
<OPTION NAME="Wisconsin">Wisconsin
</SELECT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<BR>
<TABLE BORDER="5">
<TR>
<TD>
<TABLE BORDER="0" BGCOLOR="#089494">
<TR>
<TD></TD>
<TD ALIGN="right"><B>Topic</B></TD>
<TD ALIGN="right"><B>Keyword</B></TD>
</TR>
<TR>
<TD><B>Select first search criteria:</B></TD>
<TD>
<SELECT NAME="topic" SIZE="1" ALIGN="right">
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" NAME="keyword"></TD>
</TR>
<TR>
<TD><B>Select second search criteria (optional):</B></TD>
<TD>
<SELECT NAME="topic2" SIZE="1">
<OPTION NAME="(Optional)">(Optional)
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" VALUE="(Optional)" NAME="keyword2"></TD>
</TR>
<TR>
<TD><B>Select third search criteria (optional):</B></TD>
<TD>
<SELECT NAME="topic3" SIZE="1">
<OPTION NAME="(Optional)">(Optional)
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" VALUE="(Optional)" NAME="keyword3"></INPUT></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE BORDER="0">
<TR>
<TD><INPUT TYPE="Submit" VALUE="Search The Database"></TD>
<TD><INPUT TYPE="Reset" VALUE="Reset"></TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Dec 13th, 2001, 01:40 PM
#13
Frenzied Member
And I don't see any obvious errors. The page loads, and it will submit.
Travis, Kung Foo Journeyman
As always, RTFM.
WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
YBMS, but Mozilla doesn't.
-
Dec 13th, 2001, 01:46 PM
#14
Thread Starter
Lively Member
So that shouldn't be the problem with the ASP? With this page I just get 'Javascript' error in the status bar on the bottom.
Don't ever Ginop before you Ginip 
-
Dec 13th, 2001, 08:24 PM
#15
if all you're doing is checking to see if the user filled in the text fields use this
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function valid(form) {
var name_tag = form.keyword2.value;
if (!name_tag)
{
alert("forgot to fill this field in");
return false;
}
return true;
}
// -->
</SCRIPT>
and the form
<FORM NAME="search" ACTION="Address Search Results.asp" METHOD="POST" onSubmit="return valid(this)">
I noticed you have all select fields??? why are you checking the values if they are already filled in. the only text field is optional so why are you checking the form????????
also close all you option tags. that might be a big problem.
<OPTION NAME="Alabama">Alabama</option>
-
Dec 14th, 2001, 04:07 AM
#16
Hyperactive Member
Here I got it to work in nestscape, I've commented where your mistakes where
Code:
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
//******************************************************************
//*Function verify
//*This function checks to see if fields are filled out properly.
//*Imports: form name
//*Exports: returns true if the form is filled out properly,
//* false otherwise.
//******************************************************************/
//you hadn't passed the correct parameter to this function
// it needed document.search
function verify(search){
//checks to see if Keyword is filled out.
if(search.keyword.value == ""){
alert("Please enter a keyword.");
search.keyword.focus();
return false;
}
else return true;
}
// This function sets the focus so the user can input easily.
//you hadn't passed search to the function see onload
function set_focus(search){
search.keyword.focus();
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#089494" VLINK="#089494" ALINK="#089494" ONLOAD="set_focus(document.search);">
<CENTER>
<H2>TSG Address Search</H2>
<FORM NAME="search" ACTION="Address Search Results.asp" METHOD="POST" ONSUBMIT="return verify(document.search);">
<TABLE BORDER="2">
<TR>
<TD>
<TABLE BORDER="0" BGCOLOR="#089494">
<TR>
<TD><B>Select geographic area:</B></TD>
<TD>
<SELECT NAME="location" SIZE="1">
<OPTION NAME="Alabama">Alabama
<OPTION NAME="Arizona">Arizona
<OPTION NAME="California_Pac_Bell">California_Pac_Bell
<OPTION NAME="Cincinnati_Bell">Cincinnati_Bell
<OPTION NAME="Colorado">Colorado
<OPTION NAME="Connecticut">Connecticut
<OPTION NAME="Florida Bell South">Florida_Bell_South
<OPTION NAME="Georgia Bell South">Georgia_Bell_South
<OPTION NAME="Illinois">Illinois
<OPTION NAME="Indiana">Indiana
<OPTION NAME="IRVINE CA {GTE}">Irvine_Ca_GTE
<OPTION NAME="Kansas">Kansas
<OPTION NAME="Kentucky">Kentucky
<OPTION NAME="Los_Angeles_CA">Los_Angeles_Ca_GTE
<OPTION NAME="Maryland">Maryland
<OPTION NAME="Massachusetts">Massachusetts
<OPTION NAME="Michigan">Michigan
<OPTION NAME="Minnesota">Minnesota
<OPTION NAME="Missouri">Missouri
<OPTION NAME="NEW_HAMPSHIRE">New_Hampshire
<OPTION NAME="New_Jersey">New_Jersey
<OPTION NAME="New_York">New_York
<OPTION NAME="New_Orleans_LA">New_Orleans_LA
<OPTION NAME="North_Carolina">North_Carolina
<OPTION NAME="Ohio">Ohio
<OPTION NAME="Oregon">Oregon
<OPTION NAME="Philadelphia">Philadelphia
<OPTION NAME="Pittsburgh">Pittsburgh
<OPTION NAME="San_Diego_Ca">San_Diego_CA_GTE
<OPTION NAME="Tampa_FL">Tampa_FL_GTE
<OPTION NAME="Tennessee">Tennessee
<OPTION NAME="Texas">Texas
<OPTION NAME="Texas_GTE">Texas_GTE
<OPTION NAME="Utah">Utah
<OPTION NAME="Virginia">Virginia
<OPTION NAME="Washington_State">Washington_State
<OPTION NAME="Washington_DC">Washington_DC
<OPTION NAME="Wisconsin">Wisconsin
</SELECT>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<BR>
<TABLE BORDER="5">
<TR>
<TD>
<TABLE BORDER="0" BGCOLOR="#089494">
<TR>
<TD></TD>
<TD ALIGN="right"><B>Topic</B></TD>
<TD ALIGN="right"><B>Keyword</B></TD>
</TR>
<TR>
<TD><B>Select first search criteria:</B></TD>
<TD>
<SELECT NAME="topic" SIZE="1" ALIGN="right">
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" NAME="keyword"></TD>
</TR>
<TR>
<TD><B>Select second search criteria (optional):</B></TD>
<TD>
<SELECT NAME="topic2" SIZE="1">
<OPTION NAME="(Optional)">(Optional)
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" VALUE="(Optional)" NAME="keyword2"></TD>
</TR>
<TR>
<TD><B>Select third search criteria (optional):</B></TD>
<TD>
<SELECT NAME="topic3" SIZE="1">
<OPTION NAME="(Optional)">(Optional)
<OPTION NAME="DI">Direction
<OPTION NAME="STREET">Street
<OPTION NAME="COMM">Community
</SELECT>
</TD>
<TD><INPUT TYPE="text" VALUE="(Optional)" NAME="keyword3"></INPUT></TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<TABLE BORDER="0">
<TR>
<TD><INPUT TYPE="Submit" VALUE="Search The Database"></TD>
<TD><INPUT TYPE="Reset" VALUE="Reset"></TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
this works in nestcape now.
As for the asp file it's bad practice to put spaces in a file name, try removing the spaces, try address_search_results.asp
-
Dec 14th, 2001, 04:13 AM
#17
Hyperactive Member
here's a vital webmaster tip here Crazy_bee Netscape has a JavaScript debugger built into it.
If you get a JavaScript error in Netscape type javascript: into the location bar. This will bring up a box that shows you where your errors are.
At least netscape is good for one thing eh guys !
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|