ÅؽºÆ® ¹Ú½ºÀÇ ÀԷ±ÛÀÚ¼ö Á¦ÇÑ |
|
|
![](icon/private_name/1.gif) |
12³â Àü |
textarea¿¡ ÀԷ°ªÀ» Á¦ÇÑÇϸç ÀԷ°ªÀÌ ³ÑÀ¸¸é -·Î Ç¥½ÃµË´Ï´Ù...
<script Language="Javascript">
<!--
function textCounter(theField,theCharCounter,theLineCounter,maxChars,maxLines,maxPerLine) {
var strTemp = "";
var strLineCounter = 0;
var strCharCounter = 0;
for (var i = 0; i < theField.value.length; i++) {
var strChar = theField.value.substring(i, i + 1);
if (strChar == '\n') {
strTemp += strChar;
strCharCounter = 1;
strLineCounter += 1;
} else if (strCharCounter == maxPerLine) {
strTemp += '\n' + strChar;
strCharCounter = 1;
strLineCounter += 1;
} else {
strTemp += strChar;
strCharCounter ++;
}
}
theCharCounter.value = maxChars - strTemp.length;
theLineCounter.value = maxLines - strLineCounter;
}
//-->
</script>
<!--
Æû ±¸¼º ºÎºÐ
Å° ÀÔ·Â °¨ÁöºÎºÐ
onKeyUp="textCounter(AºÎºÐ name°ª,BºÎºÐ name°ª,AºÎºÐ name°ª,CºÎºÐ name°ª,DºÎºÐ name°ª,ÃÖ´ë ±ÛÀÚ,ÃÖ´ë ¶óÀÎ,BºÎºÐ cols°ª);"
//-->
<form name="theForm"> <!-- A //-->
<textarea name="myText" cols="51" rows="10" onKeyUp="textCounter(theForm.myText,theForm.remChars,remLines,100,20,51);"></textarea><br> <!-- B //-->
<input type="text" name="remChars" value="100" size="3" maxlength="3" readonly>ÀÚ ÀÔ·Â <!-- C //-->
<input type="text" name="remLines" value="20" size="3" maxlength="3" readonly>ÁÙ ÀԷ°¡´É <!-- D //-->
</form>
|
|
̵̧ : 678 |
̵̧
¸ñ·Ï
|
|