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 ...
随机推荐
- uva 10167 - Birthday Cake
题解:由于解太多,随机抓 A.B, 只要有符合就行了: (首先,Ax+By=0必须表示直线,即A.B不能同时为0:另外,要注意到直线不能过输入中的2N个点:检测点在直线的哪一侧,只需要简单的线性规划的 ...
- Java中int和String互相转换的多种方法
1 如何将字串 String 转换成整数 int? A. 有两个方法: 1). int i = Integer.parseInt([String]); 或 i = Integer.parseInt([ ...
- MongoDB 介绍及Windows下安装
一.MongoDB简介 MongoDB是一个高性能,开源,无模式的文档型数据库,是当前NoSql数据库中比较热门的一种.它在许多场景下可用于替代传统的关系型数据库或键/值存储方式.Mongo使用C++ ...
- 左右推拽显示对比图 - jQyery封装 - 附源文件
闲来无事,做了一个模块效果 左右拖拽显示对比图,是用jq封装的 利用鼠标距离左侧(0,0)坐标的横坐标位移来控制绝对定位的left值 再配合背景图fixed属性,来制作视觉差效果 代码如下 <! ...
- Hadoop学习历程(四、运行一个真正的MapReduce程序)
上次的程序只是操作文件系统,本次运行一个真正的MapReduce程序. 运行的是官方提供的例子程序wordcount,这个例子类似其他程序的hello world. 1. 首先确认启动的正常:运行 s ...
- 关于python27 中文编码
本博文已移致独立博客:www.pubwin2009.net 传送门:http://www.pubwin2009.net/index.php/pubwin/42.html 看了网上好多的资料,以前一直不 ...
- IOS 使用新浪微博SDK
项目需要,测试了一下新浪微博SDK,现在记录一下初步使用过程. 1.下载导入新浪SDK. 2.去新浪开发者平台申请APPkey等. 3.工程中使用 4.在 APPDelegate中写两行 [Weibo ...
- LeetCode_Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, comput ...
- Qt自定义sleep延时函数(巧妙的使用时间差,但这样似乎CPU满格,而不是沉睡)
Qt不像VC++的win32/MFC编程那样,提供了现成的sleep函数可供调用.Qt把sleep函数封装在QThread类中.子线程可以调用sleep函数.但是如果用户想在主线程实现延时功能,该怎么 ...
- About Undefined Behavior[译文]
原文:blog.llvm.org/2011/05/what-every-c-programmer-should-know.html 人们偶尔会问为什么LLVM的汇编代码有时会在优化器打开时产生SIGT ...