Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple? Increase Field/Box Size

Tags:

php

We have a custom CMS on a football website. Within the CMS admin panel is a squad biography section, as shown here:

app.php

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

/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.

like image 597
Dan Avatar asked Dec 28 '11 11:12

Dan


1 Answers

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>
like image 144
Ash Burlaczenko Avatar answered Sep 29 '22 11:09

Ash Burlaczenko