Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6027461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:35:48+00:00 2026-05-23T04:35:48+00:00

When I press Backspace , Web-browser will go to previous page. How can I

  • 0

When I press Backspace, Web-browser will go to previous page. How can I disable it without preventing the clearing text ability?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:35:49+00:00Added an answer on May 23, 2026 at 4:35 am

    TWebBrowser doesn’t seem to have an OnKeydown event, and it also has many other problems. I usually forget it and go to TEmbeddedWB (embedded web browser component pack), and it has better features.

    I wrote some code to try to detect if we are in an edit control, and only conditionally block backspace keys, since as Paktas says, simply blocking the OnKey event would break editing in
    web page forms, using TEmbeddedWB, the code looks like this:

    procedure TForm2.FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    var
      element: IHTMLElement;
      elementTagName: String;
    begin
      // form contains field: EmbeddedWB1: TEmbeddedWB which is an improved version of TWebBrowser.
      element := EmbeddedWB1.GetActiveElement;
      if Assigned( element ) then
        begin
          elementTagName := element.tagName;
        end;
    
     if ( not SameText( elementTagName, 'INPUT' ) ) 
       and ( not SameText( elementTagName, 'TEXTAREA' ) ) then
      if    ((Key= VK_LEFT) and (Shift = [ssAlt]))
         or ((Key= VK_RIGHT) and (Shift = [ssAlt]))
         or (Key= VK_BROWSER_BACK)
         or (Key= VK_BROWSER_FORWARD)
         or(Key = VK_BACK) then
          begin
            Key := 0; { block backspace, but not in INPUT or TEXTAREA. }
            Exit;
          end;
    
    
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I press F5 the project compiles, and the new web page launches. However,
Hi how to disable delete key press or backspace key press when deleting a
When I have the text: new ResharperFeature And I press Ctrl-Backspace , I get:
How do I disable the backspace button when input checkboxes are focused on in
If you press and hold the 5 key on the numpad it will continue
Normally when you run a program through GDB you can press Ctrl+C to interrupt
I want to make the text field only accept numeric and backspace button from
In netbeans, if I select some text and press Tab , it works correctly
I have a situation where I need to have a backspace key press event
What preference in Eclipse controls how much is deleted when you press control-delete/backspace? This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.