不允许输入的html文本框表单 [英] html text box form that will not allow input

查看:26
本文介绍了不允许输入的html文本框表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

html 表单中是否有任何类不允许您在该文本框中输入或更改值.但是你可以看到它的内容,例如下面的代码可以让你看到mysql数据库中记录的内容.但我想要的是它不被编辑.我会在下面的代码中添加什么,以便用户不会编辑其内容:

Is there any class in an html form that does not allow you to input or change the value in that text box. But you can see its content , for example the code below will allow you to see the content of the record in mysql database. But what I want is for it not to be edited. What would I add to the code below so that its content will not be editted by the users:

   <tr>
<td><font size="3">Civil Status</td>
<td>:</td>
<td><input name="cs" type="text" maxlength="7" value="<?php echo $row["CSTAT"]; ?>"></td>
<td><font size="3">Age</td>
<td>:</td>
<td><input name="age" type="text" maxlength="3" value="<?php echo $row["AGE"]; ?>"></td>
<td><font size="3">Birthday</td>
<td>:</td>
<td><input name="bday" type="text" maxlength="12" value="<?php echo $row["BDAY"]; ?>"></td>

</tr>

<tr>
<td><font size="3">Address</td>
<td>:</td>
<td><input name="ad" type="text" maxlength="25" value="<?php echo $row["ADDRESS"]; ?>"></td>
<td><font size="3">Telephone #</td>
<td>:</td>
<td><input name="telnum" type="text" maxlength="11" value="<?php echo $row["TELNUM"]; ?>"></td>

<td width="23"><font size="3">Sex</td>
<td width="3">:</td>
<td width="174"><input name="sex" type="text"  maxlength="1" value="<?php echo $row["SEX"]; ?>"></td>
</tr>

推荐答案

readonly 属性怎么样?

<input type="text" name="telnum" value="123456" readonly="readonly" />

这篇关于不允许输入的html文本框表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆