1

I have this description box in or CRM page that displays text like this in the Description box.


Description

System Information------------------------------------------------------------------------------OS Windows 7 Home Premium x64 Edition 6.1 (build: 7600)BIOS Version HPQOEM - 42302e31Last booted 6/4/2013 5:24 PMComputer Name BRANDON-PCCPUInformation-----------------------------------------------------CPU Name AMDCPU Clock 2712 MHzCPU Description Number 2 Level 16 Model 6 Stepping 2CPU Usage 74%---------------------------------------------------------Memory Information-------------------------------Physical Memory Size 2.87 GB

The code for this text box is as follows.

<table><tr><td align="left">
    <?php echo $AppUI->_('Description');?>:
    <br />
    <textarea name="task_description" class="textarea" cols="60" rows="10" wrap="virtual"><?php echo @$obj->task_description;?></textarea>
    </td></tr></table><br />

The way that I type in is as follows:

System Information ------------------------------------------------------------------------------ OS Windows 7 Home Premium x64 Edition 6.1 (build: 7600) BIOS Version HPQOEM - 42302e31 Last booted
6/4/2013 5:24 PM Computer Name BRANDON-PCCPU Information ----------------------------------------------------- CPU Name AMD CPU Clock 2712 MHz CPU Description Number 2 Level 16 Model 6 Stepping 2 CPU Usage 74% --------------------------------------------------------- Memory Information ------------------------------- Physical Memory Size 2.87 GB

When I go back in to edit it the input box is also messed up like it's displaying. I have tried all the adding of the code from the following places but I can't get this to work.

  1. New line in text area
  2. Line breaks in textarea element

Any help is greatly appreciated.

Community
  • 1
  • 1
  • 1
    When I copy and paste the piece of text above into a textarea, it works as expected, no suprise there. I'll bet the problem isn't in the code we see here. Perhaps it's in the php, don't know how to help you without more info/code. :( – vdbuilder Jun 05 '13 at 06:27

1 Answers1

0

Try this

<?
$desc = str_replace("\n",PHP_EOL, @$obj->task_description);?>

<table>
    <tr>
        <td align="left">
           <?php echo $AppUI->_('Description');?>:
           <br />
          <textarea name="task_description" class="textarea" cols="60" rows="10" wrap="virtual">
           <?php echo $desc;?></textarea>
       </td>
     </tr>
</table><br />
K D
  • 5,889
  • 1
  • 23
  • 35