473,383 Members | 1,892 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,383 software developers and data experts.

javascript not working in mozilla firefox 2.0.0.6

Cant understand why my javascript is working in ie6 but not in mozilla.
The javascript that i hav written for validationg my form is below -
<script language="JavaScript" src="<%=request.getContextPath()%>/js/common.js"></SCRIPT>
<script language="javascript">
<!--
function formComplete(groupCode)
{
if (is_ie)
{
for (i=0; i<document.all.groups.groupId.length; i++)
{
if (groupCode == document.all.groups.groupId.options[i].text)
{
alert("This group name is already in use. Please provide a unique group name.");
return false;
}
}
if (document.all.AddGroup.groupCode.value=="")
{
alert("Please provide a group name.");
return false;
}
if (document.all.AddGroup.groupDesc.value=="")
{
alert("Please provide a group description.");
return false;
}
if (!document.all.AddGroup.groupStatus[0].checked && !document.all.AddGroup.groupStatus[1].checked)
{
alert("Please indicate the status of the new group");
return false;
}
return true;
}
}

-->

</script>

pls reply immediately.Ineed to complete this assignment as soon as possible.
thank u .
Aug 21 '07 #1
6 4818
hariharanmca
1,977 1GB
Cant understand why my javascript is working in ie6 but not in mozilla.
The javascript that i hav written for validationg my form is below -


pls reply immediately.Ineed to complete this assignment as soon as possible.
thank u .
Welcome to TSDN,
Querys may not be post here. Post in javascript/Ajax forum.
hope it's here what you need for your query.




Good Luck.
Aug 21 '07 #2
hi, i'm new to javascripting.i have a small problem but i am not able to solve it.
My javascript code is working fine in IE6 but not in mozilla.Can't fathom why?
Immediate help will be appreciated as i have to complete it today.The javascript code is given below -
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript" src="<%=request.getContextPath()%>/js/common.js"></SCRIPT>
  2. <script language="javascript">
  3. <!--
  4. function formComplete(groupCode)
  5. {
  6.     if (is_ie)
  7.     {
  8.         for (i=0; i<document.all.groups.groupId.length; i++)
  9.         {
  10.             if (groupCode == document.all.groups.groupId.options[i].text)
  11.             {
  12.                 alert("This group name is already in use.  Please provide a unique group name.");
  13.                 return false;
  14.             }
  15.         }
  16.         if (document.all.AddGroup.groupCode.value=="")
  17.         {
  18.             alert("Please provide a group name.");
  19.             return false;
  20.         }
  21.         if (document.all.AddGroup.groupDesc.value=="")
  22.         {
  23.             alert("Please provide a group description.");
  24.             return false;
  25.         }
  26.         if (!document.all.AddGroup.groupStatus[0].checked && !document.all.AddGroup.groupStatus[1].checked)
  27.         {
  28.             alert("Please indicate the status of the new group");
  29.             return false;
  30.         }
  31.         return true;
  32.     }
  33. }
  34.  
  35. -->
  36.  
  37. </script>
  38.  
Thanx
Aug 21 '07 #3
acoder
16,027 Expert Mod 8TB
Please use code tags when posting code. See the reply guidelines on the right when replying to a post. You can also specify a language, e.g. [ code=javascript], [ code=html] (without the spaces).

You are using document.all. That is non-standard and will not work in most browsers. Use document.getElementById instead, e.g.:
Expand|Select|Wrap|Line Numbers
  1. document.getElementById(id).value=...
Aug 21 '07 #4
Welcome to TSDN,
Querys may not be post here. Post in javascript/Ajax forum.
hope it's here what you need for your query.




Good Luck.
Sorry , first time .
Aug 21 '07 #5
hariharanmca
1,977 1GB
Sorry , first time .
it's Okay, just an information.
Aug 21 '07 #6
kestrel
1,071 Expert 1GB
Hey There, Welcome To The Scripts!
Im going to move this to the Javascript forum. Have a nice day!

--
Kestrel
Aug 21 '07 #7

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

Similar topics

8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.