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 6781733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:39:32+00:00 2026-05-26T16:39:32+00:00

How to know which character(s) is(are) get deleted on backspace or delete button click

  • 0

How to know which character(s) is(are) get deleted on backspace or delete button click when editing text in textarea.

I want to get character get deleted on backspace or delete button click to detect if deleted character is new line character.

  • 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-26T16:39:32+00:00Added an answer on May 26, 2026 at 4:39 pm

    Well you can do 2 things.
    You could either store the current value and compare it to the new value.
    Or you can try to catch the event before it really does what it has to do.

    I found this prevent backspace function here
    check if its any use of you.
    You can use the SelectionStart function to find out what the position of your cursor is.
    By checking the keycode you can determine if the backspace or delete button was pressed.
    Delete will mean: position +1 is the character being deleted.
    Backspace will mean: position -1 is the character being deleted.

    Because you are preventing backspace and/or delete to trigger their original event you have all the time to find those things out.
    Once you know all the information you needed to know you can manually remove the character from the string and update the text in the textarea.

    Not sure if its the best way but it seems like something that could work like this.

    Hope this helped you in any way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know which tool can be used to measure the cyclomatic complexity
Does anyone know which property sets the text color for disabled control? I have
I know of several ways to get a character off a string given the
I want to take a character from a file.txt which has only one character
I would like to know which dependency described in my pom.xml brings a transitive
I'd like to know which libraries are used by executables on my system. More
I'd like to know which method is recommended on Windows C programming: using malloc
How do I know which files and registry keys an application is trying to
I would like to know which one is the best material that I can
Does anyone know which permissions are required for refreshing or connecting to linked tables

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.