Hi, On my website I have a log in page written in html. It has on it a very simple form with just two fields, userid & password and a login button at the bottom.
There are two ways you can log in...
1) Enter the user name and then the password. Press the enter key after inputting the password. An onChange will catch this and call up the javascript login() function which is embedded in the page.
2) Enter both user name and password and then click on the login button. Clicking on this button also calls the same login() function through <a href="javascript:login().....
The odd behaviour is, depending on how the login() function is called (method 1 or 2 above) it does different things.
What is it supposed to do, is to "encrypt" the password using an external md5 function then using window.location it will take the user to the next page with the user id & encrypted password passed to it as a query string.
This works fine when you CLICK on the login button. But, if you have pressed enter after the password, the new page does not get shown but the query string only (including an unencrypted password) is shown in the URL bar.
Please try it and see. www.wallfillers.com/trade password and username are both "mac".
I've just installed the latest Safari for 10.4.11 and it still does it. Firefox works properly. Also IE and Firefox on the PC work properly.
I cannot understand how a function can operate differently depending on where it's called from. (well I can think of a 100 reasons, but in THIS simple case I can't think of one especially as it works in other browsers.)
It's got me stumped
EDIT: I have just installed Safari 3.1.2 on Vista and that shows the same odd behaviour.
There are two ways you can log in...
1) Enter the user name and then the password. Press the enter key after inputting the password. An onChange will catch this and call up the javascript login() function which is embedded in the page.
2) Enter both user name and password and then click on the login button. Clicking on this button also calls the same login() function through <a href="javascript:login().....
The odd behaviour is, depending on how the login() function is called (method 1 or 2 above) it does different things.
What is it supposed to do, is to "encrypt" the password using an external md5 function then using window.location it will take the user to the next page with the user id & encrypted password passed to it as a query string.
This works fine when you CLICK on the login button. But, if you have pressed enter after the password, the new page does not get shown but the query string only (including an unencrypted password) is shown in the URL bar.
Please try it and see. www.wallfillers.com/trade password and username are both "mac".
I've just installed the latest Safari for 10.4.11 and it still does it. Firefox works properly. Also IE and Firefox on the PC work properly.
I cannot understand how a function can operate differently depending on where it's called from. (well I can think of a 100 reasons, but in THIS simple case I can't think of one especially as it works in other browsers.)
It's got me stumped
EDIT: I have just installed Safari 3.1.2 on Vista and that shows the same odd behaviour.