douchushao7799 2011-12-28 11:15
浏览 14
已采纳

简单? 增加字段/框大小

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.

  • 写回答

4条回答 默认 最新

  • douzhou7124 2011-12-28 11:19
    关注

    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 />", "
    ", $row['biography']); ?></li>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题