views:

57

answers:

3

the login box is in the header of the website, availalbe on all pages. I'm using a javascript :

<script type="text/javascript" language="javascript">
       history.forward();

Which solves the issue of the backspace in the login box. But while I'm browsing the rest of the website, I can use backspace to see the previous page, I'd have to use the navigation menu only. How can I solve that issue ?

A: 

A webpage changing the key bindings of the browser is a controversial topic, as this violates the principle of the least surprise (which should be familiar to an UX designer). Also, not all browsers have this key mapping (Bksp -> Go back).

That said: you can try capturing the key events, as described e.g. here and cancelling the event propagation. Not sure if this is possible for all keys, so you'd have to try and see.

Piskvor
Thank you very much for your answer, I'll check the link you posted. About the User Experience subject, the stakeholders, owners of the company, the people who give me a paycheck are the end users as well, and regarding of this specific system which is just for them and for a limited amount of clients, they REQUIRE that feature. I understand your concern tho. They're very keyboard oriented people, as this is a finances website. Sometimes there's nothing to do about certain things, no other option, if they want that, I'll give them that.
UXdesigner
@UXdesigner: Yeah, I understand...having the client who effectively says "but I *want* my website to be ugly and unusable, make it so!" is painful :-|
Piskvor
The site itself looks amazing. But user testing revelead that as we use three separate character for password boxes , and if someone places a mistaken key, and hits backspace, itbrings you back to the previous page, not to the previous field. Most people don't know the Shift-Tab key combination. that's all.
UXdesigner
A: 

Try this JavaScript

<script for="document" event=onkeydown>

// Check if this is a Backspace
 if (window.event.keyCode == 8)
 {
    // Cancel backspace if not in a text element
    if(document.activeElement.type != "text")
    {
        window.event.returnValue=false;
    }
 }
 </script>
hehongyu2000
A: 

If you're using a proper HTML text input box and the focus is on it then backspace will not take the user back. If you're not using a proper HTML input box then I suggest you do so. Browsers handle this stuff for you.

Tim Down
It's actually a .NET application, not an html input box precisely.It's an ASP Panel... If I do write a good username, a good valid username...it will bring three little boxes of 1 character each, with an algorythm, it asks you a position of a character of your password. . . then you're IN.Thing is, I placed the <script type="text/javascript" language="javascript"> history.forward(); it does it well, can't hit back...but I can't hit back in the rest of the pages of the site.!! that's all :)
UXdesigner