View Full Version : .htaccess w/ javascript - the next step

12-06-2002, 09:03 PM

Two questions:

1) In order to get rid of the popup boxes that result from protecting an area on a site with .htaccess, I have created a form in HTML that uses javascript to pass the user variables. I have also created a 401 access denied page.

Everything works beautifully if you enter the correct password.

The problem is this:
If you enter the wrong password that darn popup box appears again asking you to enter your password again. If I enter the wrong password enough times in the popup box it will eventually bring me to the 401 screen I made.

But how do I get it to either skip the popup box and go directly to the 401, or give me another chance to enter my password on the HTML page, so you never get that popup box.

2) How do I bring focus to the login button on my original form so you can just hit enter after typing in the password instead of manually having to move the mouse to click the button.

thanks in advance

12-06-2002, 10:13 PM
i think this is the kind of thing that's better done with a server side language. if you want, i'll move this thread there, unless someone has some really nifty JS for this.

12-07-2002, 12:13 AM
sure, if you think it is better posted in the server side lanuguage forum then please move.


PS - also figured out a work around for the second problem on bringing focus to the button. used javascript to track the "enter" button keystroke instead of passing focus.