Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 661
  • Last Modified:

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??
0
John Gates, CISSP
Asked:
John Gates, CISSP
  • 2
  • 2
  • 2
  • +3
2 Solutions
 
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
 
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
zastilCommented:
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
 
hackman_3vilGuyCommented:
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now