<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标签的更多相关文章

  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. vim+ctags+cscope工具

    最近在看一个开源的项目,突然发现在Linux上不知道有什么方便的工具来看开源代码.以前,在Windows上用VS2010集成开发环境,对于任意一个函数直接有快捷键跳转到函数定义处.可现在在Linux上 ...

  2. ASP.NET环境下集成CKEditor与CKEditor实现文件上传

    1.从http://ckeditor.com网站上下载ckeditor_aspnet_3.6.4与ckfinder_aspnet_2.4; 2.解压下载的文件ckeditor_aspnet_3.6.4 ...

  3. 在Ajax中将数组转换成字符串(0517-am)

    一.如何在Ajax中将数组转换成字符串 1. 主页面; <head> <meta http-equiv="Content-Type" content=" ...

  4. resumable.js —— 基于 HTML 5 File API 的文件上传组件 支持续传后台c#实现

    在git上提供了java.nodejs.c#后台服务方式:在这里我要用c#作为后台服务:地址请见:https://github.com/23/resumable.js 我现在visual studio ...

  5. Commons Beanutils使用setProperty() - 就是爱Java

    有时不能只依靠getter/setter操作bean,如:需要名字动态取得的,或是访问bean内的field,甚至是集合或数组内bean的field,利用反射机制对bean的field进行处理,这时候 ...

  6. android系统自带的Service原理与使用

    1. 说明 android的后台运行在很多service,它们在系统启动时被SystemServer开启,支持系统的正常工作,比如 MountService监听是否有SD卡安装及移除,Clipboar ...

  7. cf B. Fence

    http://codeforces.com/contest/363/problem/B #include <cstdio> #include <cstring> #includ ...

  8. PowerShell 字符串操作符

    字符串操作符 格式化操作符 –F 在PowerShell文本操作符中非常重要,经常被用来增强数字类型和日期类型的可读性: "{0} diskettes per CD" -f (72 ...

  9. logstash ArgumentError: comparison of String with 5 failed

    <pre name="code" class="html"><pre name="code" class="ht ...

  10. apache 启动不了

    netstat -ano|findstr "443" 发现443端口被占 记录下443端口对应的PID 进入任务管理器,查看进程,发现为一个叫做vmware-hostd.exe的进 ...