Hi,
I have a problem with our intranet, we are planning to install Firefox
instead of Internet Explorer onto some new PCs.
However, we can't get the following JavaScript to work in Firefox and
similar code is used in lots of the intranet stuff.
The code should bring up a message box with a warning and not allow
the user to continue unless they have filled in the entry in an html
form (the form is called 'myauthor').
if (checkempty(Document.myauthor.Candidate.Value,"You have left the
Candidate field empty."))= false then validation=false
If validation= True then
myauthor_OnSubmit = True
else
myauthor_OnSubmit = False
End if
End function
Function checkempty(ByVal FieldValue, ByVal message)
If FieldValue = "" then
MsgBox message, 8, Header
checkempty = False
else
checkempty = true
End if
end function
No errors or warnings appear in the firefox JavaScript console. The
page just accepts the form and continues as if the checking code
weren't there at all.
Thanks for any help,
Dave 4 3638
Dave Blair wrote: However, we can't get the following JavaScript to work in Firefox and similar code is used in lots of the intranet stuff. The code should bring up a message box with a warning and not allow
if (checkempty(Document.myauthor.Candidate.Value,"You have left the Candidate field empty."))= false then validation=false
If validation= True then myauthor_OnSubmit = True else myauthor_OnSubmit = False End if End function
Function checkempty(ByVal FieldValue, ByVal message) If FieldValue = "" then MsgBox message, 8, Header checkempty = False else checkempty = true End if end function
No errors or warnings appear in the firefox JavaScript console. The page just accepts the form and continues as if the checking code weren't there at all.
That is not JavaScript but VBScript so there is no way FireFox or any
other browser besides IE/Win is going to run that code.
--
Martin Honnen http://JavaScript.FAQTs.com/
Dave Blair wrote: Hi, I have a problem with our intranet, we are planning to install Firefox instead of Internet Explorer onto some new PCs.
However, we can't get the following JavaScript to work in Firefox and similar code is used in lots of the intranet stuff. The code should bring up a message box with a warning and not allow the user to continue unless they have filled in the entry in an html form (the form is called 'myauthor').
if (checkempty(Document.myauthor.Candidate.Value,"You have left the Candidate field empty."))= false then validation=false
If validation= True then myauthor_OnSubmit = True else myauthor_OnSubmit = False End if End function
Function checkempty(ByVal FieldValue, ByVal message) If FieldValue = "" then MsgBox message, 8, Header checkempty = False else checkempty = true End if end function
No errors or warnings appear in the firefox JavaScript console. The page just accepts the form and continues as if the checking code weren't there at all.
Thanks for any help, Dave
Hmm ... perhaps it's because most of the code, you've written isn't
Javascript - but rather VBScript which is also supported in IE
i've taken the liberty to rewrite it (sort of) in javascript...
function checkEmpty( value, errMessage ) {
if(value=="") {
Alert( errMessage );
return false;
} else {
return true;
}
}
if( checkEmpty( document.forms['myauthor'].candidate.value, "You have
left the Candidate field empty..." ) ) {
/* validation ok - submit the form */
document.forms['myauthor'].submit();
} else {
/* don't do anything - vaidation failed */
return false;
}
/Søren Munk Skrøder
Odense, Denmark
soeren at skroeder dot dk
I'm an idiot!!
I knew it was VBscript, but had just finished with another problem
that was Javascript (a menu, which is now working). And somehow my
brain hadn't woken up and...........monday morning.....and......
Anyway, thanks for the replies and the re-write!
On Mon, 28 Jun 2004 14:45:06 +0200,
=?ISO-8859-1?Q?S=F8ren_Munk_Skr=F8der?= <a@b.com> wrote: Dave Blair wrote:
Hi, I have a problem with our intranet, we are planning to install Firefox instead of Internet Explorer onto some new PCs.
However, we can't get the following JavaScript to work in Firefox and similar code is used in lots of the intranet stuff. The code should bring up a message box with a warning and not allow the user to continue unless they have filled in the entry in an html form (the form is called 'myauthor').
if (checkempty(Document.myauthor.Candidate.Value,"You have left the Candidate field empty."))= false then validation=false
If validation= True then myauthor_OnSubmit = True else myauthor_OnSubmit = False End if End function
Function checkempty(ByVal FieldValue, ByVal message) If FieldValue = "" then MsgBox message, 8, Header checkempty = False else checkempty = true End if end function
No errors or warnings appear in the firefox JavaScript console. The page just accepts the form and continues as if the checking code weren't there at all.
Thanks for any help, Dave
Hmm ... perhaps it's because most of the code, you've written isn't Javascript - but rather VBScript which is also supported in IE
i've taken the liberty to rewrite it (sort of) in javascript...
function checkEmpty( value, errMessage ) { if(value=="") { Alert( errMessage ); return false; } else { return true; } }
if( checkEmpty( document.forms['myauthor'].candidate.value, "You have left the Candidate field empty..." ) ) { /* validation ok - submit the form */ document.forms['myauthor'].submit(); } else { /* don't do anything - vaidation failed */ return false; }
/Søren Munk Skrøder Odense, Denmark soeren at skroeder dot dk
Dave Blair wrote: Hi, I have a problem with our intranet, we are planning to install Firefox instead of Internet Explorer onto some new PCs.
However, we can't get the following JavaScript to work in Firefox and similar code is used in lots of the intranet stuff.
[snip] Function checkempty(ByVal FieldValue, ByVal message) If FieldValue = "" then MsgBox message, 8, Header checkempty = False else checkempty = true End if end function
That code (above) is VBScript, not JavaScript or ECMAScript, so it has
no chance on anything except Microsoft-only browsers written to work
with Micrososft-only code. In other words - it will never run on Firefox
OR on any non-Wondows system. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Howard Kaikow |
last post by:
Yesterday, I decided to try Firefox. I've encountered a behavior that is
either a bug in Firefox or a bug in my Javascript code. I'll try to explain
the problem, hoping that this newsgroup can...
|
by: LRW |
last post by:
(Sorry if this is a repost...my newsreader keeps crashing on the
posting--I don't know if the message going out or not)
For some reason this javascript just won't work in Firefox. It works
fine...
|
by: tshad |
last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an
asp.net problem or a javascript problem.
I have a page that was originally created from a program I found on the net...
|
by: John |
last post by:
I've been working on making my ASP.NET web apps compatible with Firefox (the
uplevel configs for web.config are a real help).
However, one really weird thing is a GotoAnchor() function I have...
|
by: chrisdude911 |
last post by:
how do i add video into a javascript web page with my own custom
buttons?
|
by: minnesotti |
last post by:
Hi there,
I subscribed to a photographic pictures-hosting website which is heavy
on JavaScript. My preferred latest browser Mozilla Firefox does not
work with it -- no pictures are displayed and...
|
by: Adam |
last post by:
Hello All,
I have run into a JS / CSS layout issue in IE, and I can't for the life
of me figure out what's going on. Basically, I have one DIV that is
expanding beyond the bounds of the...
|
by: Eric |
last post by:
I have a user of a web application written in Java/JSP that is unable
to login to the site simply because certain links on the page do not
run when they are clicked. Other popups using Javascript...
|
by: scotty |
last post by:
I have a script that loops through an existing table list and prepares
each href element node to trigger a function when an image is
clicked. The function that will be run passes a property value...
|
by: willyWEB66 |
last post by:
Hi everyone, I'm having problem with the sequence of execution for xml.onload. It works fine if your not passing parameters to onload event but my code needs to pass parameter to its function. I'm...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: DJRhino |
last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer)
If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _
310030356 Or 310030359 Or 310030362 Or...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
| |