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

  • Home
  • SEARCH
  • 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 8462235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:06:40+00:00 2026-06-10T14:06:40+00:00

I have textarea , user keeps writing inside it without pressing enter. If they

  • 0

I have textarea, user keeps writing inside it without pressing enter. If they press enter I get \n char which I need, but sadly they are not pressing enter and instead they just keep typing!

Now, Is there any way I can add new line character inside the string just after the textarea move to next line?

Potential Duplicate : Automatic newline in textarea

Note : The question shared above has an accepted answer. But the link is not working 🙁 The other options aren’t very efficient.

I have several technologies to manipulate the String I am getting from <textarea>. So feel free to give solution for any single one.

  • HTML
  • JavaScript
  • Twig
  • php
  • CSS
  • 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-06-10T14:06:42+00:00Added an answer on June 10, 2026 at 2:06 pm

    One way to solve this problem is to make the text area auto-resizing. Thus, the user starts with a single line textarea and as soon as the text becomes too long, the textarea adjusts its height to give a new empty line to the user.

    Check this question or do some research using your fav. search engine if you need a way to do this.

    As soon as the script triggers a height change, you can append a newline before the latest character.

    // Update: You might want to check the behavior of a textarea because the text gets most likely wrapped before the latest word. You’ll have to write an algo which retrieves the position in the text where you need to insert the LF in order not to break the text. This sounds complicated but shouldn’t be too hard. Just check after which chars the text gets wrapped and search for the last appearance of one of these chars.

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

Sidebar

Related Questions

I have textarea in my site(link shortening site) i want to user enter some
I have a textarea in which the user enters the following data: Paul:Nine, Rome
I have a Table,Button and a Textarea, When a user types inside the Textarea
Here's my problem: I have a textarea where the user can enter whatever he
I have textarea in the UI which i display text inside it from db
I have a textarea where I insert \n when user presses enter. Code from
I have a textarea form in my html. If the user hits enter between
In my application, I have a form with textarea. If a user keeps typing
I have a textarea, which I need to be able to take characters including
I have a textarea where when the user selects and presses enter I want

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.