Results 1 to 2 of 2

Thread: How can i disable backspace navigation with javascript

  1. #1
    Hyperactive Member
    Join Date
    Sep 06
    Location
    Greater Manchester, UK
    Posts
    467

    How can i disable backspace navigation with javascript

    I have written an app in javascript with 2 divs, on load the 1st is visible and the 2nd is hidden. When a user completes the 1st div they then procced to the 2nd div, for usability if a user wants to go back i would like them to be able to use the backspace.

    i have the code to catch the keypress of the backspace on the 2nd div and use it to go back to the 1st div.

    However when i press backspace, the browser navigates to my previous page rather than to my 1st div.

    thanks chris1990
    If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.

    If you fail, try and try again, its the only way to success.

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 08
    Location
    Trivandrum, Kerala, India
    Posts
    7,557

    Re: How can i disable backspace navigation with javascript

    Have you tried returning "false" at the end in the keypress event ? Otherwise, the default behavior might occur.


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD Athlon X2 5200+, ASUS Motherboard, 2 GB RAM, 400 GB HDD, Nvidia 8600 GT 512MB, 19.5" TFT(Wide), Creative 5.1 Home Theater

    Social Group: VBForums - Developers from India

    Skills: PHP, MySQL, jQuery, VB.Net, VB6, Photoshop...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •