Home > Backend Development > PHP Tutorial > 关于PHP动态修改表单文本框属性的有关问题

关于PHP动态修改表单文本框属性的有关问题

WBOY
Release: 2016-06-13 10:25:01
Original
884 people have browsed it

关于PHP动态修改表单文本框属性的问题
如题.
------已经连接数据库--------------






循环语句结束>

我是想当数据表里的value有值的时候.把text文本框添加readonly属性并把提交按钮隐藏.
求大神教导.

------解决方案--------------------
>

>
------解决方案--------------------
这样容易理解,代码我就不优化了
PHP code
    <?php if (!empty($res['value'])) {        echo "<input type=\"text\" name=\"tex\" value=\"{$res['value']}\" readonly>";        echo "<input type='\"submit\"' name='\"sub\"' disabled>";    } else {        echo "<input type='\"text\"' name='\"tex\"' value="\"{$res['value']}\"">";        echo "<input type='\"submit\"' name='\"sub\"'>";    }    ?>    <input type="hidden" name="id" value="<?php echo $res['id'] ?>"><br><font color="#e78608">------解决方案--------------------</font><br>2楼正解11111111111111111<div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template