How to make a textarea act more like wordpad

Posted on 2004-04-27
Last Modified: 2006-11-17
I am looking for solutions to making a textarea behave more like wordpad etc as far as wrapping..  Someone out there got any ideas??
Question by:John Gates
  • 2
  • 2
  • 2
  • +3
LVL 32

Expert Comment

ID: 10937985
I am afraid if this is what you want !!!???

You have an attribute called WRAP in <TEXTAREA>..

Forms TextArea Wrap Tutorial:

Can you be more specific!?...

LVL 17

Author Comment

by:John Gates
ID: 10938565
Um not going to be that easy....  I have the text box being filled by data from a mainframe.  When you go to edit a line it is wrapping down and looking like this:

Line from mainframe.
Line I tried to add

instead of

Line from mainframe.  Line I try to add
LVL 28

Expert Comment

ID: 10940046
>> I have the text box being filled by data from a mainframe

Mainframes use a different character for hard-return then Windows.

use some code to replace CHR(13) with CHR(13) & CHR(10)

or in javascript: replace '\r' with '\n'

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!


Assisted Solution

zastil earned 100 total points
ID: 10940294
How about using div instead of textbox

<div style="overflow: scroll;width:50px;height:50px" nowrap>Line from mainframe.  Line I try to add</div>
LVL 17

Author Comment

by:John Gates
ID: 10940562
Um the div is not a bad idea, but I need to get the data back to the mainfram system when the page is submitted.....  

Accepted Solution

hackman_3vilGuy earned 400 total points
ID: 10998749
Oooo! Pick me!


function getdiv(){
var divtext = thediv.innerText;
hiddenitem.value = divtext;
return true;

<div id="thediv" style="overflow: scroll;width:50px;height:50px" nowrap>Line from mainframe.  Line I try to add</div>
<FORM NAME="formid" ID="formid" ACTION="hdfjhk.cgi" METHOD="POST" onSubmit="getdiv();">
<INPUT TYPE="HIDDEN" NAME="hiddenitem" ID="hiddenitem" VALUE=" " />

This will send the div's text as hiddenitem onSubmit.

~Cool. I h8 computers. They crash a lot!
LVL 18

Expert Comment

ID: 11429826
innerText only works in Internet Explorer.
innerHTML should be used instead.

LVL 32

Expert Comment

ID: 11429847

Are you in holidays ... ?

LVL 18

Expert Comment

ID: 11429864
go to my profile and contact me if you can. Hate using EE as a messenger system =oP

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Web Development Tools for MVC 3 91
Question on web subscription for apps 3 107
Lines Not Lining Up 2 70
How to get statistic's from a competitors website?! 1 104
Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to count occurrences of each item in an array.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question