css 文本域textarea显示成label标签
<html>
<head>
<title>textarea显示为label</title>
<style type="text/css">
.textdisplay {
background-color:#eeeeee;
border-bottom-style:none;
border-left-style:none;
border-right-style:none;
border-top-style:none;
font-size:14px;
}
</style>
<script language="javascript">
function setTxt(obj){
if(obj=='e'){
document.getElementById('sendcontent').className='';
document.getElementById('sendcontent').readOnly=false;
document.getElementById('save').disabled=false;
document.getElementById('cancel').disabled=false;
}
if(obj=='c'){
document.getElementById('sendcontent').className='textdisplay';
document.getElementById('sendcontent').readOnly=true;
document.getElementById('save').disabled=true;
document.getElementById('cancel').disabled=true;
}
}
</script>
</head>
<body>
<textarea class="textdisplay" cols="" rows="" id="sendcontent" name="sendcontent" style="height:500px;width:600px;" readonly>
<input type="submit" disabled=true id="save" name="save" value="保存" style="height:24px;vertical-align:middle;line-height:20px;" />
<input type="button" name="edit" value="编辑" style="height:24px; vertical-align:middle;line-height:20px;" onclick="setTxt('e')" />
<input type="button" disabled=true id="cancel" name="cancel" value="取消" style="height:24px; vertical-align:middle;line-height:20px;" onclick="setTxt('c')" />
</body>
</html>
css 文本域textarea显示成label标签的更多相关文章
- 文本域textarea显示输入剩余字数
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- 文本域textarea
文本域 CreateTime--2017年5月23日15:12:08Author:Marydon 二.文本域 (一)语法 <textarea></textarea> (二) ...
- palacehoder的自定义样式【输入框input /文本域textarea】
7.palacehoder的自定义样式[输入框input /文本域textarea] 因为每个浏览器的CSS选择器都有所差异,所以需要针对每个浏览器做单独的设定(可以在冒号前面写input和texta ...
- 解决:HTML中多文本域(textarea)回车后数据存入数据库,EL表达式取出异常。
问题描述: 当多文本域(textarea)回车后数据存入数据库. EL表达式取出异常,值换行倒置页面报错. 问题解决: 存值脚本代码,提交前转换\n为<br/>. <script t ...
- CSS 文本溢出时显示省略标记
如标题所示... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.o ...
- 占满屏幕的宽高,当把textarea换成其他标签的时候,怎么才能编辑?
$('.nav').width($(window).width()); $('.nav').height($(window).height()); 当把textarea换成其他标签的时候,怎么才能 ...
- Bootstrap 表单控件一(单行输入框input,下拉选择框select ,文本域textarea)
单行输入框,常见的文本输入框,也就是input的type属性值为text.在Bootstrap中使用input时也必须添加type类型,如果没有指定type类型,将无法得到正确的样式,因为Bootst ...
- css文本超出隐藏显示省略号
p style="width: 300px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> 如 ...
- html文本域textarea高度自增、自动换行
文本域自动换行.高度自增,采用以下方式: html: <textarea rows="1" class="answerTextArea" maxlengt ...
随机推荐
- c笔试题(1)
1.sizeof和strlen的区别 #include<stdio.h> #include<string.h> int main() { char a[10] = " ...
- hdu 5188
it's a dp difficult problem 试想如果我们遇见这样一道题,: 有n道题目,每道题有一个得分v和用时t: 我们要得够w分:用时最少 怎么做?? 这是一个裸奔的01背包 如 ...
- uva 352 - The Seasonal War
題意: 要確認畫面中有幾隻Eagles,每個pixel如果是'1'代表為一隻Eagles,但上下左右(包含斜角共8個方向)相連的'1'只能算是同一隻. 想法: 使用DFS找'1'有幾個區域. #inc ...
- Go语言之defer
defer语句被用于预定对一个函数的调用.我们把这类被defer语句调用的函数称为延迟函数.注意,defer语句只能出现在函数或方法的内部. 一条defer语句总是以关键字defer开始.在defer ...
- A + B Problem,hdu-1000
A + B Problem Problem Description Calculate A + B. Input Each line will contain two integers A and ...
- 关于js事件冒泡和时间捕获
(1)冒泡型事件:事件按照从最特定的事件目标到最不特定的事件目标(document对象)的顺序触发. IE 5.5: div -> body -> document IE 6.0: div ...
- 关于MPLS协议几个容易忽略的点
1.随着硬件技术的进步,产生了高速路由器和三层交换机,MPLS提高转发的速度的初衷已经没有多少意义.但是MPLS由于其支持标签栈和面向连接的特点,使其在虚拟专用网,流量工程,QoS等方面得到广泛的应用 ...
- (摘)DataGuard物理standby管理 - 主备切换
DataGuard物理standby管理 - 主备切换 Dataguard的切换分为两种,switchover和failover. switchover一般用于数据库或硬件升级,这时只需要较短时间中断 ...
- Gson 禁止特殊字符转码
Map<String,String> map = new HashMap<String,String>(); map.put("url", "&a ...
- logstash tag使用说明
zjtest7-frontend:/usr/local/logstash-2.3.4/config# cat stdin04.conf input { stdin { } } filter { # d ...