Friday, July 10, 2020

Preserve line breaks in textarea

Generally you just need to add
  • white-space: pre-line; whitespace trimmed to single whitespace or
  • white-space: pre-wrap; all whitespace preserved
to the element's style (CSS), where you want your text rendered with line-breaks.

You can do:
white-space: pre-wrap;
overflow-wrap: break-word;
You keep output in textarea as it is. You would receive input as a string output that string(write to file) that string adding textarea to the input string.
for eg.
<?php
$txt = $_POST["inputstr"];
$txt1 = "<textarea>". $txt ."</textarea>";
$file = fopen("file.html","a+");
fwrite($file, $txt1);
fclose($file);
?>



Lazarus-ide text editor:
tutorials:

No comments:

Post a Comment

Beogradsko programiranje=