473,385 Members | 1,856 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.

javascript is not working in firefox

Hi,

The below javascript is not working in the firefox, Please help me..

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function Login(){
  3. var done=0;
  4. var username=document.login.username.value;
  5. username=username.toLowerCase();
  6. var password=document.login.password.value;
  7. password=password.toLowerCase();
  8. if (username=="adventure" && password=="adventure") { window.location="myaccount/Redeem_Game_Card.html"; done=1; }
  9. if (done==0) {
  10. document.getElementById("error_msg").style.display = "block";
  11.  }
  12. }
  13. </SCRIPT>
Sep 4 '08 #1
16 2001
Hi, The below javascript is not working in the firefox. Please help me..

[HTML]<script>
function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="adventure" && password=="adventure") { window.location="myaccount/Redeem_Game_Card.html"; done=1; }
if (done==0) {
document.getElementById("error_msg").style.display = "block";
}
}
</SCRIPT>


<a href="#" onClick="javascript:Login()">LOGIN</a>[/HTML]
Sep 4 '08 #2
Nepomuk
3,112 Expert 2GB
Hi srinathpandit! Welcome to bytes.com!

It's great to have you here!

When you post, please always keep to the Posting Guidelines and when you post code, please post it in [code] ... [/code] tags. Just look at how much nicer your code would look with them:
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function Login(){
  3.    var done=0;
  4.    var username=document.login.username.value;
  5.    username=username.toLowerCase();
  6.    var password=document.login.password.value;
  7.    password=password.toLowerCase();
  8.    if (username=="adventure" && password=="adventure") {
  9.       window.location="myaccount/Redeem_Game_Card.html"; done=1; }
  10.    if (done==0) {
  11.       document.getElementById("error_msg").style.display = "block";
  12.    }
  13. }
  14. </SCRIPT>
  15.  
  16.  
  17. <a href="#" onClick="javascript:Login()">LOGIN</a>
(although I did indent it manually)

As I've seen, you've also posted your question in the Javascript / DHTML / Ajax Forum - which is the right place for it. This isn't. So in future, please post your questions only in the relevant forum.

Otherwise, I'll just wish you the best and hope you enjoy being part of bytes.com!

Greetings,
Nepomuk
Sep 4 '08 #3
What error message u r getting?
U can see the error message under Tools -->Error Console

-Hussain
Sep 4 '08 #4
Hi,

Thanks for reply.

I am not getting any error message, But script is working in IE but not in firefox.
The requirement is, On giving user ID and Password, onclick on submit button,
the page should go to the Redeem_Game_Card.html.

This is not working in firfox.

I checked the error Console, There is no script errors on it on some CSS issues are there.
Sep 4 '08 #5
What error message u r getting?
U can see the error message under Tools -->Error Console

-Hussain
Hi,

Thanks for reply.

I am not getting any error message, But script is working in IE but not in firefox.
The requirement is, On giving user ID and Password, onclick on submit button,
the page should go to the Redeem_Game_Card.html.

This is not working in firfox.

I checked the error Console, There is no script errors on it, only some CSS issues are there.
Sep 4 '08 #6
acoder
16,027 Expert Mod 8TB
Show the corresponding HTML code.
Sep 4 '08 #7
Show the corresponding HTML code.

Hi,

The below code is HTML code for login page,

----------------------------------------------------------------------------
[HTML] <p class="input_title">
Email Address:<br />
<input name="username" type="text" class="input_box" />
</p>
<p class="input_title">
Password:<br />
<input name="password" type="password" class="input_box" />
</p>

<p class="checkbox"><input type="checkbox" />Remember me</p>
<span class="privacy_link"><a href="/customercare/privacypolicy.aspx">Privacy Policy</a></span>

<div class="red_btn">
<a href="#" onClick="javascript:Login()">LOGIN</a>
<div style="clear:both;"></div>
</div>[/HTML]
Sep 4 '08 #8
acoder
16,027 Expert Mod 8TB
Is your form named "login"?
Sep 4 '08 #9
Is your form named "login"?
yes..

<form name="login" method="post" id="aspnetForm">
Sep 4 '08 #10
Is your form named "login"?
yes...

<form name="login" method="post">
Sep 4 '08 #11
acoder
16,027 Expert Mod 8TB
When you say it's not working, what happens? Does it just stay on the page even if you input the correct username/password?

PS. you shouldn't have login code on the client-side.
Sep 4 '08 #12
yes..
in IE it will go to Redeem_Game_Card.html page, but in Firefox it will saty in that page only and it wont show any error also, Is there any error in the code? i am confused...

Is there any other way or code for this type of requirement.
Sep 4 '08 #13
acoder
16,027 Expert Mod 8TB
From a cursory look, the JavaScript code seems OK.

The HTML for the link could be changed to this:
Expand|Select|Wrap|Line Numbers
  1. <a href="#" onclick="Login(); return false;">LOGIN</a>
or better still use a button:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" onclick="Login()" value="LOGIN">
Sep 4 '08 #14
acoder
16,027 Expert Mod 8TB
Threads merged.

Moderator.
Sep 4 '08 #15
Threads merged.

Moderator.

Thank you so much, Its working (return false;). You r a genius........

Its working in both IE and Firefox.
Sep 5 '08 #16
acoder
16,027 Expert Mod 8TB
You're welcome. Glad to help.
Sep 5 '08 #17

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

Similar topics

4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
1
by: nitinp | last post by:
hello, I am trying to validate empty textbox value by javascript in Firefox. It is working fine in IE but not in Firefox. Note - code is for ASP.NET <script runat="server"> protected void...
8
by: sultanwadood | last post by:
Hi all. I need to know how to disable javascript through javascript in firefox. thanks in advance if some one could help me. Sultan Wadood.
6
by: ApOG | last post by:
Hello everyone, I have this javascript code working perfectly with IE, but with firefox nothing happens when running the function... function add_div_field () { var ni =...
1
by: web20tester | last post by:
Hi all, I am new to javascript. I have this script working fine in IE but cannot work in firefox. Really appreciate on any guidance. search0.js function Search(str) { var...
1
by: aal | last post by:
Hi experts, How would look the following IE javaScript in Firefox? var wrd = new ActiveXObject("Word.Application"); var excl = new ActiveXObject("Excel.Application"); Thanks aal
3
by: yurcheg | last post by:
Hi, I've searched the forum for this problem but haven't found anything relevant. I've got a javascript code which dynamically creates list-boxes in a form. It works perfectly fine in IE, but in...
26
by: itgaurav198 | last post by:
Hi, I have the following script function submitForm1() { document.forms.action="SearchRecords"; document.forms.submit(); }
1
by: Rewire | last post by:
This script seems to work fine with firefox but not with IE. It just sets style="display:none" or style="display:" to show / hide submenu items on my menu. I've just tried making it save to a cookie...
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: 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?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.