How to make a textarea act more like wordpad

I am looking for solutions to making a textarea behave more like wordpad etc as far as wrapping..  Someone out there got any ideas??
LVL 18
John Gates, CISSPSecurity ProfessionalAsked:
Who is Participating?
 
hackman_3vilGuyConnect With a Mentor Commented:
Oooo! Pick me!


<SCRIPT>

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

</SCRIPT>
<BODY>
<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=" " />
</FORM>
</BODY>

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

~Cool. I h8 computers. They crash a lot!
0
 
ldbkuttyCommented:
I am afraid if this is what you want !!!???


You have an attribute called WRAP in <TEXTAREA>..
http://www.htmlcodetutorial.com/forms/_TEXTAREA_WRAP.html

Forms TextArea Wrap Tutorial:
------------------------------------
http://www.web-wise-wizard.com/html-tutorials/html-form-forms-textarea-wrap.html

Can you be more specific!?...

0
 
John Gates, CISSPSecurity ProfessionalAuthor Commented:
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
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
sybeCommented:
>> 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'



0
 
zastilConnect With a Mentor Commented:
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>
0
 
John Gates, CISSPSecurity ProfessionalAuthor Commented:
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.....  
0
 
CrYpTiC_MauleRCommented:
innerText only works in Internet Explorer.
innerHTML should be used instead.


Regards,
Nick
0
 
ldbkuttyCommented:
CrYpTiC_MauleR,

Are you in holidays ... ?

:-)
0
 
CrYpTiC_MauleRCommented:
ldbkutty,
go to my profile and contact me if you can. Hate using EE as a messenger system =oP
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.