0
Good night, you guys.
One more trick I’m in doubt in my system. I’ve done everything at the beginning of the page with PHP to do a search in my database. But there is a field that I am bringing through the mysqli_fetch_array that I need to bring in the original formatting that was typed in a textarea of a form.
Ai at the time of bringing I created this line in my HTML (But it went wrong):
<input type="text" id="texto-os" style="height: 150px;" name="texto_os" class="form-control" placeholder="Descreva o Serviço" value="<?php echo '<pre>'.$dados_os['ordem_servico'].'</pre>'?>
The result of this is: (All in one row (even though it was recorded with line breaks, and showing the tag as if it had not been running them.
<pre>Texto que vem do Banco de Dados</pre>
I even switched to <input type="text>
"because when I was in <textarea>
did not show my Database content.
Anyway, in other codes I use the tag after echo to bring the original formatting, but this usually I did at once in the file only with PHP.
This time for practicality, I’m bringing field to field the answers to fill out my form since I still don’t know how to do it via Javascript.
I’m doing wrong or really have no way to use pre inside the html tag value?
Hugs
You really need to put the
<pre></pre>
within the<textarea>
? I tested it here and it didn’t work, I don’t think I can.– Leandro Lima
So, is that this field will be a Service Order Summary. So one will type a lot in a few broken lines. Sure. Then to be better to visualize, I will need to treat this text in some way.
– Rafael