douxiapi4381 2018-06-04 09:17
浏览 426

如何动态更改textarea值?

im creating a textarea field in php, that text area should be such a way that what ever i enter for example say "i love coding in php" and later if i click on that link then "i love coding in php" should be changed to what ever link i select, but when i entre anything then click on the link then the page is getting refreshed, please can any one help to solve this issue please

            <?php
            $font = "courier";
            $size = "";
            $color = "";

            if(isset($_GET['font'])){
                $font = $_GET['font'];
            }

            if(isset($_GET['size'])){
                $size = $_GET['size'];
            }

            if(isset($_GET['color'])){
                $color = $_GET['color'];
            }
            ?>

            <div style="padding-left:130px ; padding-top:50px">

                <textarea rows="4" cols="50" placeholder="Enter Something" style="font-family: <?php echo $font; ?> ; font-size: <?php echo $size; ?> ; color: <?php echo $color; ?>"></textarea>

                <br><br>
                <div>
                    <a href="?font=arial">Arial</a> 
                    <a href="?font=times">Times</a>
                    <a href="?font=impact">Impact</a> 
                    <a href="?font=verdana">Verdana</a>
                </div>

                <br><br>
                <div>
                    <a href="?size=30px">30px</a> 
                    <a href="?size=10px">10px</a>
                    <a href="?size=50px">50px</a> 
                    <a href="?size=60px">60px</a>
                </div>

                <br><br>
                <div>
                    <a href="?color=red">RED</a> 
                    <a href="?color=pink">PINK</a>
                    <a href="?color=blue">BLUE</a> 
                    <a href="?color=yellow">YELLOW</a>
                </div>

            </div>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥15 stable diffusion
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘