1. <html>
  2. <head>
  3.     <title>textarea显示为label</title>
  4. <style type="text/css">
  5. .textdisplay {
  6.    background-color:#eeeeee;
  7.    border-bottom-style:none;
  8.    border-left-style:none;
  9.    border-right-style:none;
  10.    border-top-style:none;
  11.    font-size:14px;
  12. }
  13. </style>
  14. <script language="javascript">
  15. function setTxt(obj){
  16.     if(obj=='e'){
  17.       document.getElementById('sendcontent').className='';
  18.       document.getElementById('sendcontent').readOnly=false;
  19.       document.getElementById('save').disabled=false;
  20.       document.getElementById('cancel').disabled=false;
  21.     }
  22.     if(obj=='c'){
  23.           document.getElementById('sendcontent').className='textdisplay';
  24.           document.getElementById('sendcontent').readOnly=true;
  25.           document.getElementById('save').disabled=true;
  26.           document.getElementById('cancel').disabled=true;
  27.         }
  28. }
  29.   
  30. </script>
  31. </head>
  32.   
  33. <body>
  34.   
  35. <textarea class="textdisplay" cols="" rows="" id="sendcontent" name="sendcontent" style="height:500px;width:600px;" readonly>
  36.  <input type="submit" disabled=true id="save" name="save" value="保存" style="height:24px;vertical-align:middle;line-height:20px;" />
  37. <input type="button" name="edit" value="编辑" style="height:24px; vertical-align:middle;line-height:20px;" onclick="setTxt('e')" />
  38. <input type="button" disabled=true id="cancel" name="cancel" value="取消" style="height:24px; vertical-align:middle;line-height:20px;" onclick="setTxt('c')" />
  39. </body>
  40. </html>

css 文本域textarea显示成label标签的更多相关文章

  1. 文本域textarea显示输入剩余字数

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. 文本域textarea

      文本域 CreateTime--2017年5月23日15:12:08Author:Marydon 二.文本域 (一)语法 <textarea></textarea> (二) ...

  3. palacehoder的自定义样式【输入框input /文本域textarea】

    7.palacehoder的自定义样式[输入框input /文本域textarea] 因为每个浏览器的CSS选择器都有所差异,所以需要针对每个浏览器做单独的设定(可以在冒号前面写input和texta ...

  4. 解决:HTML中多文本域(textarea)回车后数据存入数据库,EL表达式取出异常。

    问题描述: 当多文本域(textarea)回车后数据存入数据库. EL表达式取出异常,值换行倒置页面报错. 问题解决: 存值脚本代码,提交前转换\n为<br/>. <script t ...

  5. CSS 文本溢出时显示省略标记

    如标题所示... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.o ...

  6. 占满屏幕的宽高,当把textarea换成其他标签的时候,怎么才能编辑?

    $('.nav').width($(window).width()); $('.nav').height($(window).height());   当把textarea换成其他标签的时候,怎么才能 ...

  7. Bootstrap 表单控件一(单行输入框input,下拉选择框select ,文本域textarea)

    单行输入框,常见的文本输入框,也就是input的type属性值为text.在Bootstrap中使用input时也必须添加type类型,如果没有指定type类型,将无法得到正确的样式,因为Bootst ...

  8. css文本超出隐藏显示省略号

    p style="width: 300px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;"> 如 ...

  9. html文本域textarea高度自增、自动换行

    文本域自动换行.高度自增,采用以下方式: html: <textarea rows="1" class="answerTextArea" maxlengt ...

随机推荐

  1. cas+tomcat+shiro实现单点登录-1-tomcat添加https协议

    目录 1.tomcat添加https安全协议 2.下载cas server端部署到tomcat上 3.CAS服务器深入配置(连接MYSQL) 4.Apache Shiro 集成Cas作为cas cli ...

  2. POJ3484 Showstopper (二分+字符串处理)

    POJ3484 Showstopper 题目大意: 每次给出三个数x,y,z,用这三个数构成一个等差数列,x为首项,y是末项,z是公差 总共给出n组x,y,z( n待定),求这n组数列中出现次数为奇数 ...

  3. sublime3 ctl+b无效

    Preference->Browse Packages->python,编辑Python.sublime-build文件,在字典里添加path item,value为你的python路径, ...

  4. Winform控件缩写

    控件名称 缩写 Buttom按钮 Btn CheckBox复选框 Chk ColumnHeader视图列表头 Col ComboBox组合框 Cbo ContextMenu快捷菜单 Ctm DataG ...

  5. 使用Jquery解决Asp.Net中下拉列表值改变后访问服务器刷新界面。

    使用DropDownList控件时,改变选项时,获取服务端数据库数据并刷新界面数据. 1. 绑定DropDownList控件SelectedIndexChanged事件. 2. AutoPortBac ...

  6. Apache配置rewrite

    最近将代码做了迁移,更换了web服务器,从原来的Nginx,换成使用Apache,多少有些区别.这里整理一下在apache下实现rewrite功能. 第一部分:修改apache配置文件支持rewrit ...

  7. bzero()等的区别

    bzero  原型: extern void bzero(void *s, int n); 用法: #include <string.h> 功能:置字节字符串s的前n个字节为零.    说 ...

  8. Zookeeper,也要接触起来啦

    分布式的东东,就是部署也方便,但管理,想法,大集群应用是要点...! 参考如下URL简单实现 ,以后应用时多留意. http://blog.csdn.net/shirdrn/article/detai ...

  9. Powershell ForEach-Object 循环

    Powershell管道就像流水线,对于数据的处理是一个环节接着一个环节,如果你想在某一环节对流进来的数据逐个细致化的处理,可是使用ForEach-Object,$_ 代表当前的数据. 对管道对象逐个 ...

  10. Spring事务管理器分类

    Spring并不直接管理事务,事实上,它是提供事务的多方选择.你能委托事务的职责给一个特定的平台实现,比如用JTA或者是别的持久机制.Spring的事务管理器可以用下表表示: 事务管理器的实例 目标 ...