Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to make a textarea act more like wordpad

Posted on 2004-04-27
Medium Priority
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, CISSP
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 18

Author Comment

by:John Gates, CISSP
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'

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Assisted Solution

zastil earned 400 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 18

Author Comment

by:John Gates, CISSP
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 1600 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

670 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