Editor js_texteara
.b1{height:20px;border:1px solid #7f9db9;line-height:20px; padding:0}
input.btn{height:auto; font-size:14px; font-weight:bold; color:#000}
#main {color:#666}
textarea{border:1px solid #7f9db9; font-size:14px; width:448px; color:#3851B7}
input{font-size:14px; color:#000}
#main h3{color:#000}
.grey{color:#999}
em{font-style:normal; color:#FF0000; font-size:12px;}
#msg1,#msg2,#msg3,#msg4{ display:none}
#ol{position:absolute; z-index:1; padding:0px; margin:0px; border:0px; background:#ecf0f5;width:23px; text-align:left; }
#li{background:#ecf0f5; height:160px; overflow:hidden; width:23px; border-right:0; line-height:20px; margin:0px; padding:0px; padding-left:2px; text-align:center}
#c2{font-family:Arial, Helvetica, sans-serif; height:160px; margin:0px; width:420px; padding:0 0 0 28px; overflow-x: hidden; line-height:20px;}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> In the text box displays line numbers, compatible browser ie, ff </title>
<link rel="stylesheet" href="onLineNumber.css" type="text/css" media="all" />
<script src="onLineNumber.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
function says(){
var text = document.getElementById('c2');
alert(text.value);
var eee = document.getElementById('eee');
eee.innerHTML = text.value;
}
</script>
</head>
<body onLoad="keyUps();">
<div>
<table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="55%">
<div><textarea cols="2" rows="10" disabled></textarea></div>
<textarea name="sdd" cols="60" rows="10" wrap="off" onkeyup="keyUps()" onscroll="G('li').scrollTop = this.scrollTop;" oncontextmenu="return false" >
a
b
cd
dasfsdfas
sdfa
sdfa
</textarea>
</td>
</tr>
</table>
</div>
<span>sss</span>
<em> Cannot be empty. </em>
</body>
</html>
/**
* @author Administrator
*/
String.prototype.trim2 = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
function F(objid){
return document.getElementById(objid).value;
}
function G(objid){
return document.getElementById(objid);
}
var msgA=["msg1","msg2","msg3","msg4"];
var c=["c1","c2","c3","c4"];
var slen=[50,20000,20000,60];// Allows the maximum number of words
var num="";
var isfirst=[0,0,0,0,0,0];
function isEmpty(strVal){
if( strVal == "" )
return true;
else
return false;
}
function isBlank(testVal){
var regVal=/^\s*$/;
return (regVal.test(testVal))
}
function chLen(strVal){
strVal=strVal.trim2();
var cArr = strVal.match(/[^\x00-\xff]/ig);
return strVal.length + (cArr == null ? 0 : cArr.length);
}
function check(i){
var iValue=F("c"+i);
var iObj=G("msg"+i);
var n=(chLen(iValue)>slen[i-1]);
if((isBlank(iValue)==true)||(isEmpty(iValue)==true)||n==true){
iObj.style.display ="block";
}else{
iObj.style.display ="none";
}
}
function checkAll(){
for(var i=0;i<msgA.length; i++){
check(i+1);
if(G(msgA[i]).style.display=="none"){
continue;
}else{
alert(" Fill out the error , Please view the Red tips! ");
return;
}
}
G("form1").submit();
}
function clearValue(i){
G(c[i-1]).style.color="#0909F7";
keyUps();
// if(isfirst[i]==0){
// G(c[i-1]).value="";
// }
// isfirst[i]=1;
}
function keyUps(){
var obj=G("c2");
var str=obj.value;
str=str.replace(/\r/gi,"");
str=str.split("\n");
n=str.length;
line(n);
}
function line(n){
var lineobj=G("li");
for(var i=1;i<=n;i++){
if(document.all){
num+=i+"\r\n";
}else{
num+=i+"\n";
}
}
lineobj.value=num;
num="";
}
function autoScroll(){
var nV = 0;
if(!document.all){
nV=G("c2").scrollTop;
G("li").scrollTop=nV;
setTimeout("autoScroll()",20);
}
}
if(!document.all){
window.addEventListener("load",autoScroll,false);
} <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> In the text box displays line numbers, compatible browser ie, ff </title>
<link href="style/public.css" rel="stylesheet" type="text/css">
<style type="text/css">
.b1{height:20px;border:1px solid #7f9db9;line-height:20px; padding:0}
input.btn{height:auto; font-size:14px; font-weight:bold; color:#000}
#main {color:#666}
textarea{border:1px solid #7f9db9; font-size:14px; width:448px; color:#000}
input{font-size:14px; color:#000}
#main h3{color:#000}
.grey{color:#999}
em{font-style:normal; color:#FF0000; font-size:12px;}
#msg1,#msg2,#msg3,#msg4{ display:none}
#ol{position:absolute; z-index:1; padding:0px; margin:0px; border:0px; background:#ecf0f5;width:23px; text-align:left; }
#li{background:#ecf0f5; height:160px; overflow:hidden; width:23px; border-right:0; line-height:20px; margin:0px; padding:0px; padding-left:2px; text-align:center}
#c2{font-family:Arial, Helvetica, sans-serif; height:160px; margin:0px; width:420px; padding:0 0 0 28px; overflow-x: hidden; line-height:20px;}
</style>
<script language="javascript" type="text/javascript">
String.prototype.trim2 = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
function F(objid){
return document.getElementById(objid).value;
}
function G(objid){
return document.getElementById(objid);
}
</script>
</head>
<body onLoad="keyUp();">
<h3><em>*</em> The album tracks: </h3>
<div>
<table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="55%">
<div><textarea cols="2" rows="10" disabled></textarea></div>
<textarea name="co" cols="60" rows="10" wrap="off" onkeyup="keyUp()" onscroll="G('li').scrollTop = this.scrollTop;" oncontextmenu="return false" > Cowboy Jay Chou
Goodbye Jacky Cheung
Colorful Days Hackberry
Beautiful myth hanhong Sun Nan </textarea>
</td>
<td width="45%" valign="top"><p> In the text box displays line numbers, compatible browser ie, ff </p>
<p> Enter the content back to the end-of-line, a line number appears. Support for pasting. JS code is the code from the work out of picking, there may be some redundancy. </p>
</td>
</tr>
</table>
</div>
<em> Cannot be empty. </em>
<script language="javascript" type="text/javascript">
var msgA=["msg1","msg2","msg3","msg4"];
var c=["c1","c2","c3","c4"];
var slen=[50,20000,20000,60];// Allows the maximum number of words
var num="";
var isfirst=[0,0,0,0,0,0];
function isEmpty(strVal){
if( strVal == "" )
return true;
else
return false;
}
function isBlank(testVal){
var regVal=/^\s*$/;
return (regVal.test(testVal))
}
function chLen(strVal){
strVal=strVal.trim2();
var cArr = strVal.match(/[^\x00-\xff]/ig);
return strVal.length + (cArr == null ? 0 : cArr.length);
}
function check(i){
var iValue=F("c"+i);
var iObj=G("msg"+i);
var n=(chLen(iValue)>slen[i-1]);
if((isBlank(iValue)==true)||(isEmpty(iValue)==true)||n==true){
iObj.style.display ="block";
}else{
iObj.style.display ="none";
}
}
function checkAll(){
for(var i=0;i<msgA.length; i++){
check(i+1);
if(G(msgA[i]).style.display=="none"){
continue;
}else{
alert(" Fill out the error , Please view the Red tips! ");
return;
}
}
G("form1").submit();
}
//function clearValue(i){
// G(c[i-1]).style.color="#000";
// keyUp();
// if(isfirst[i]==0){
// G(c[i-1]).value="";
// }
// isfirst[i]=1;
//}
function keyUp(){
var obj=G("c2");
var str=obj.value;
str=str.replace(/\r/gi,"");
str=str.split("\n");
n=str.length;
line(n);
}
function line(n){
var lineobj=G("li");
for(var i=1;i<=n;i++){
if(document.all){
num+=i+"."+"\r\n";
}else{
num+=i+"."+"\n";
}
}
lineobj.value=num;
num="";
}
function autoScroll(){
var nV = 0;
if(!document.all){
nV=G("c2").scrollTop;
G("li").scrollTop=nV;
setTimeout("autoScroll()",20);
}
}
if(!document.all){
window.addEventListener("load",autoScroll,false);
}
</script>
</body>
</html>
Related Posts of Editor js_texteara
-
Dynamic loading JS script four kinds of methods
To achieve dynamic loading JS script has four kinds of methods: 1, direct document.write <script language="javascript"> document.write ( "<script src='test.js'> <\ / script>"); </ script> 2, dynamic ...
-
spring myfaces hibernate richfaces
1.web.xml 2, spring 3, faces-config.xml
-
Spring + Hibernate to use Glassfish Database Connection Pool
applicationContext.xml file content <? xml version = "1.0" encoding = "UTF-8"?> <beans xmlns = " http://www.springframework.org/schema/beans " xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance " ...
-
Process migration from tomcat to websphere changes
Process migration from tomcat to websphere changes Because customers use the web application server software used by different what tomcat5, tomcat6, websphere5.1, websphere6.1, weblogic8, and so on, and the software used inconsistent standards, ibm& ...
-
JAVA EE JSP_JNDI
dsfdsa http://lindows.javaeye.com/admin/blogs/213348 Tomcat 6 with the connection pool data source configuration http://www.blogjava.net/ec2008/archive/2008/07/19/216063.html project: test Driver path: D: \ workspace \ test \ WebRoot \ WEB-INF \ lib ...
-
Servlet brief introduction
Servlet brief introduction: Servlet is a small application server Are used to complete the B / S architecture, the client requests the response to treatment Platform independence, performance, able to run thread Servlet API for Servlet provides the s ...
-
Spring2.0 + hibernate3.1 + log4j + mysql demo
applicationContext.xml Non-attachment jar package, necessary friends can send an email to todd.liangt @ gmail.com













Leave a Reply