We have a custom CMS on a football website. Within the CMS admin panel is a squad biography section, as shown here:
On the above screenshot you will see the ‘Biography’ section highlighted. The code for this section within /app.php is;
<ul class="tr">
<li class="td1">Biography</li>
<li class="td2"><input type="text" name="biography" value="<?=$row['biography']; ?>" /></li>
</ul>
I’m trying to make the Biography box bigger as this field will require several paragraphs. Currently, it’s just one character limited row.
I’m also hoping to replicate making the box bigger on the actual outcome too. Screenshot of which is here:
/index.php contains this code;
<ul class="tr">
<li><?=$row['biography']; ?></li>
</ul>
Any help as to how I can make the input and output boxes bigger (to accommodate paragraphs rather than one single line) would be massively appreciated.
Instead of using an input
element try a textarea
.
<textarea name="biography"><?=$row['biography']; ?></textarea>
The element is sizeable based on the rows and columns you need.
<textarea rows="10" cols="50"></textarea>
Then on your display page you need to replace the newlines (created by the textarea) with <br />
tags.
<li><?= str_replace("<br />", "\n", $row['biography']); ?></li>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With