473,385 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

java script not supported in my mozilla browser

HI everybody
I am writing java script code it's working fine in IE browser and not working fine in Mozilla
code:
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT LANGUAGE="JavaScript">
  2.     function verify() {
  3.         var themessage = "You are required to complete the following fields: ";
  4.         if (document.form.title.value=="") {
  5.         themessage = themessage + " - Class Title";
  6.         }
  7.         //alert if fields are empty and cancel form submit
  8.         if (themessage == "You are required to complete the following fields: ") {
  9.             document.form.submit();
  10.         } else {
  11.             alert(themessage);
  12.             event.returnValue=false;
  13.         }
  14.     }
  15. </script>
  16.  
  17. <form enctype="multipart/form-data" method="post"  name="form" onSubmit="verify()" action="admin_addclass2.php">
  18.  
  19.  
  20. //fields here
  21. </form>
  22.  
what is wrong with that it gives alert message in mozilla but post next page when we click ok in alart box (actually when we click OK in alert box it display same page )

please send me any suggestion with that.

Cheers

ramana
Mar 7 '09 #1
2 2365
Dormilich
8,658 Expert Mod 8TB
could be a name confusion. there is a universal attribute called "title" in HTML, which you can access via html_element.title, thus making document.form.title.value point to <form title="" ...> (which is empty) ...
Mar 7 '09 #2
acoder
16,027 Expert Mod 8TB
Try the following changes:
Expand|Select|Wrap|Line Numbers
  1.         if (themessage == "You are required to complete the following fields: ") {
  2.             return true;
  3.         } else {
  4.             alert(themessage);
  5.             return false;
  6.         }
and
Expand|Select|Wrap|Line Numbers
  1. <form enctype="multipart/form-data" method="post"
  2.   name="form" 
  3. onSubmit="return verify()"...
Mar 7 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: William Korvine | last post by:
I have been Googling (and still am), but thought I'd just ask. I have an application that needs a scripting language. I have written my own interpreted language (a small subset of C++), but am...
3
by: Steve W | last post by:
I've searched over and over again and have not been able to find a definitive answer. Basically, we have a heavily JavaScripted web site. What I was hoping to do was to start enhancing our site...
4
by: Robert | last post by:
Hi, which DOM version (level) should I learn? I've seen that there is a DOM level 3, but is there any support for it already? -- Rob
7
by: news frontiernet.net | last post by:
I have a project that uses mouse-over JS script to show and hide layers that works well in MSIE 6.0 and Opera. But, it does not work in NS nor Mozilla. It is here: ...
6
by: opt_inf_env | last post by:
Hello, I have found, that one can generate a nice font with the usage of the following line (for example): <font face="Edwardian Script ITC" size="7"> Very nice </font> Do you know whether...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
9
by: DavidB | last post by:
Hi all I have a script that works perfectly in IE but not in FF. I am sure that the problem is easy to resolve, but I seem to be too dumb to figure it out. <html> <head> <script...
5
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called...
15
by: remi | last post by:
Hi, I would like to write a script that will load a js file according to the browser used. Here is the suggested code : **** function detectBrowser() { var browser=navigator.appName;
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.