473,738 Members | 8,397 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Login Control problems in Firefox

Hello,
I'm using a Login Control on asp.net 2.0 website and it works fine on
IE & Firefox, however I have recently added a javscript function to
listen for a 'return-key-click' and am encountering problems with
Firefox.
If the user clicks the 'Login' button with a mouse button click, it
works fine, however if the user hits enter, the form fields are
cleared and the user is not logged in.
Please note, this only happens if the user has 'remember passwords'
checked in their Firefox preferences.

Thanks for your time,
Max

//attached javascript:

var objLogin = {
controls : document.getEle mentsByTagName( 'input'),
loginButton : null,
userName : null,
password : null,
init : function(){
for (var i=0;i<objLogin. controls.length ;i++)
{
if (objLogin.contr ols[i].type == 'image')
{
objLogin.loginB utton = objLogin.contro ls[i];
}
else if
(objLogin.contr ols[i].getAttribute(' id').indexOf('L oginView1_Login 1_UserName')>=0 )
{
objLogin.userNa me = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.use rName, "keydown",
objLogin.setDef ault);
}
else if
(objLogin.contr ols[i].getAttribute(' id').indexOf('L oginView1_Login 1_Password')>=0 )
{
objLogin.passwo rd = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.pas sword,"keydown" ,
objLogin.setDef ault);
}
else if
(objLogin.contr ols[i].getAttribute(' id').indexOf('L oginView1_Login 1_RememberMe')> =0)
{
objLogin.passwo rd = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.pas sword,"keydown" ,
objLogin.setDef ault);
}
}
},
setDefault : function(e){
if (!e) var e=window.event;

if (e.keyCode == 13)
{
if (e.stopPropagat ion)
{
e.stopPropagati on();
e.preventDefaul t();
}
else
{
e.returnValue=f alse;
e.cancel = true;
}
if (objLogin.login Button!=null)
objLogin.loginB utton.click();
}
},
addEvent : function(obj, evType, fn){
if (obj.addEventLi stener)
{
obj.addEventLis tener(evType, fn, false);
return true;
}
else if (obj.attachEven t)
{
var r = obj.attachEvent ("on"+evType , fn);
return r;
}
else
{
return false;
}
}
}

Mar 1 '07 #1
2 1790
i don't see anything obvious, but you are canceling the current event
and firing a new one. i change:

objLogin.loginB utton.click();

to
window.setTimeo ut(function(){o bjLogin.loginBu tton.click();}) ;

also asp.net has a built set default button function you could use
instead (see panel).

-- bruce (sqlwork.com)

md****@medelect .co.uk wrote:
Hello,
I'm using a Login Control on asp.net 2.0 website and it works fine on
IE & Firefox, however I have recently added a javscript function to
listen for a 'return-key-click' and am encountering problems with
Firefox.
If the user clicks the 'Login' button with a mouse button click, it
works fine, however if the user hits enter, the form fields are
cleared and the user is not logged in.
Please note, this only happens if the user has 'remember passwords'
checked in their Firefox preferences.

Thanks for your time,
Max

//attached javascript:

var objLogin = {
controls : document.getEle mentsByTagName( 'input'),
loginButton : null,
userName : null,
password : null,
init : function(){
for (var i=0;i<objLogin. controls.length ;i++)
{
if (objLogin.contr ols[i].type == 'image')
{
objLogin.loginB utton = objLogin.contro ls[i];
}
else if
(objLogin.contr ols[i].getAttribute(' id').indexOf('L oginView1_Login 1_UserName')>=0 )
{
objLogin.userNa me = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.use rName, "keydown",
objLogin.setDef ault);
}
else if
(objLogin.contr ols[i].getAttribute(' id').indexOf('L oginView1_Login 1_Password')>=0 )
{
objLogin.passwo rd = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.pas sword,"keydown" ,
objLogin.setDef ault);
}
else if
(objLogin.contr ols[i].getAttribute(' id').indexOf('L oginView1_Login 1_RememberMe')> =0)
{
objLogin.passwo rd = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.pas sword,"keydown" ,
objLogin.setDef ault);
}
}
},
setDefault : function(e){
if (!e) var e=window.event;

if (e.keyCode == 13)
{
if (e.stopPropagat ion)
{
e.stopPropagati on();
e.preventDefaul t();
}
else
{
e.returnValue=f alse;
e.cancel = true;
}
if (objLogin.login Button!=null)
objLogin.loginB utton.click();
}
},
addEvent : function(obj, evType, fn){
if (obj.addEventLi stener)
{
obj.addEventLis tener(evType, fn, false);
return true;
}
else if (obj.attachEven t)
{
var r = obj.attachEvent ("on"+evType , fn);
return r;
}
else
{
return false;
}
}
}
Mar 1 '07 #2
alf
Hi, I would like to force postback when retunr key is pressed but I don't
found the property to do this.
What you mean about "see panel" ??
thanks.

"bruce barker" <no****@nospam. comwrote in message
news:e%******** ********@TK2MSF TNGP03.phx.gbl. ..
>i don't see anything obvious, but you are canceling the current event and
firing a new one. i change:

objLogin.loginB utton.click();

to
window.setTimeo ut(function(){o bjLogin.loginBu tton.click();}) ;

also asp.net has a built set default button function you could use instead
(see panel).

-- bruce (sqlwork.com)

md****@medelect .co.uk wrote:
>Hello,
I'm using a Login Control on asp.net 2.0 website and it works fine on
IE & Firefox, however I have recently added a javscript function to
listen for a 'return-key-click' and am encountering problems with
Firefox.
If the user clicks the 'Login' button with a mouse button click, it
works fine, however if the user hits enter, the form fields are
cleared and the user is not logged in.
Please note, this only happens if the user has 'remember passwords'
checked in their Firefox preferences.

Thanks for your time,
Max

//attached javascript:

var objLogin = {
controls : document.getEle mentsByTagName( 'input'),
loginButton : null,
userName : null,
password : null,
init : function(){
for (var i=0;i<objLogin. controls.length ;i++)
{
if (objLogin.contr ols[i].type == 'image')
{
objLogin.loginB utton = objLogin.contro ls[i];
}
else if
(objLogin.cont rols[i].getAttribute(' id').indexOf('L oginView1_Login 1_UserName')>=0 )
{
objLogin.userNa me = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.use rName, "keydown",
objLogin.setDe fault);
}
else if
(objLogin.cont rols[i].getAttribute(' id').indexOf('L oginView1_Login 1_Password')>=0 )
{
objLogin.passwo rd = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.pas sword,"keydown" ,
objLogin.setDe fault);
}
else if
(objLogin.cont rols[i].getAttribute(' id').indexOf('L oginView1_Login 1_RememberMe')> =0)
{
objLogin.passwo rd = objLogin.contro ls[i];
objLogin.addEve nt(objLogin.pas sword,"keydown" ,
objLogin.setDe fault);
}
}
},
setDefault : function(e){
if (!e) var e=window.event;

if (e.keyCode == 13)
{
if (e.stopPropagat ion)
{
e.stopPropagati on();
e.preventDefaul t();
}
else
{
e.returnValue=f alse;
e.cancel = true;
}
if (objLogin.login Button!=null)
objLogin.login Button.click();
}
},
addEvent : function(obj, evType, fn){
if (obj.addEventLi stener)
{
obj.addEventLis tener(evType, fn, false);
return true;
}
else if (obj.attachEven t)
{
var r = obj.attachEvent ("on"+evType , fn);
return r;
}
else
{
return false;
}
}
}

Mar 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
4871
by: Ghazan Haider | last post by:
I am posting this for the lack of a better newsgroup, and for the knowledge of people here, and because its only partially OT. We have a bunch of users with their computers at work. There are reports that the users need, which could be in html, php, asp, jsp, whatever. Now I am trying to eliminate the login window entirely. In an html request, the client (firefox, ie, etc) sends the clients hostname, IP, a bunch of other stuff, but...
0
1288
by: Steve Commisso | last post by:
I'm trying to create a forked login where users of certain roles will be redirected to specific pages. The easy way to do this would be to do the redirecting in the Page_Load() of the default page after login, but I'd like to skip this step and just have the Login control go ahead and do it. So my plan is this: override the OnLoggedIn() method of the Login control with my own custom method that changes the DestinationPageUrl property...
49
3980
by: Atul Chaturvedi | last post by:
If we use ASP.NET 2.0 Login Control, we are unable to click on Login and Reset Buttons on Safari running on Apple Mac OS X Version 10.3.2 . How can i resolve the problem.
3
1504
by: goot | last post by:
I'm trying to use the login control and have it use the membership provider framework to authenticate users and am having a problem (which i'm sure will turn out to be a stupid mistake on my part)... this is what I have done thus far: Created a database on a sql 2000 server and then used the aspnet_regsql tool to create the membership tables I then modified the web.config as such:
6
3358
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in the past in other places, and while the help was much appreciated, it seemed everyone just wanted to 'theoretically' explain how to do it, but when I tried to do it myself, I couldn't login. I want to simply pass the email address and password to...
0
12780
by: barrybevel | last post by:
Hi, I'm trying to login to the www.vodafone.ie website using HttpWebRequest. It works fine with IE/Firefox and the .NET Web Control too, just not with my code. I think it's a redirect 302 problem. I'm using this code in a ASP.NET 2.0 application just in case that matters, maybe someone knows a better way to do this?
2
2302
by: =?Utf-8?B?U2hhbm5vbg==?= | last post by:
I am trying to publish an application to a server that I do not have desktop access to because of our hosting environment. I publish to a file share. The WEB site has been configured by the hosts personnel. When I deploy to my localhost or dev server everything work like it should, Entering a valid user name and password redirectos me to the appropriate page. When I publish to the staging server and try to login, the login page just...
2
1497
by: SF | last post by:
Hi, I am nes to ASP.NET. I try to develop on online form for my office that requiore use to login using Windows Authentication (Use name active directory). I am search to web and could not found any sample. Appreciate if someone provide some lead. SF
10
4819
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey Jones, then login as David Smith the Welcome message below will show "Welcome Davey". And it will be Davey's information that is accessible - not David Smith's. So something is amiss but I don't know what. (BTW, this login script is based on the...
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9476
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9263
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.