Is there a way to add line breaks in a textarea without the user having to press "Enter", so that these empty lines will be visible when printing?
<html >
<head>
<!-- script print button -->
<script type="text/javascript">
function printTextArea() {
childWindow = window.open('','childWindow','location=yes, menubar=yes, toolbar=yes');
childWindow.document.open();
childWindow.document.write('<html><head></head><body dir="rtl">');
childWindow.document.write(document.getElementById('targetTextArea').value.replace(/\n/gi,'<br/>'));
childWindow.document.write('</body></html>');
childWindow.print();
childWindow.document.close();
childWindow.close();
}
</script>
<style type="text/css">
textarea {
direction: rtl;
background-color: white;
font-size: 1em;
font-weight: bold;
font-family: Verdana, Arial, Helvetica, sans-serif;
border: 1px solid #00acee;
resize: none;
}
</style>
</head>
<body>
<p>
<TEXTAREA name="thetext" rows="20" cols="80"id="targetTextArea" placeholder="Copy and paste your text here to fill it out, edit it, and then print using the button below ......">
</TEXTAREA>
</p>
<!-- print button -->
<center> <input type="button" onclick="printTextArea()" value="Print"/></center>
</body>
</html>