Dan
Dan

Reputation: 115

Simple? Increase Field/Box Size

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.

Upvotes: 5

Views: 308

Answers (4)

Ash Burlaczenko
Ash Burlaczenko

Reputation: 25475

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>

Upvotes: 7

HarryBeasant
HarryBeasant

Reputation: 490

Yeah, as the other guy said, it would be best using a textarea, like this;

<TEXTAREA Name="content" ROWS=2 COLS=20></TEXTAREA>

This way you can select the size of width and length and it would still have all the functionality of a input field.

Upvotes: -2

Osman Turan
Osman Turan

Reputation: 1371

This plugin expands a text box to show entire lines when necessary: http://www.no-margin-for-errors.com/projects/prettycomments/

Upvotes: 0

Manoj
Manoj

Reputation: 497

you can use <textarea> instead of <input /> box

Upvotes: 0

Related Questions