³»¿ëÀÌ ´Ã¾î³ª¸é Textarea¹Ú½º°¡ ÀÚµ¿À¸·Î ´Ã¾î³³´Ï´Ù.. |
|
|
|
16³â Àü
|
<html>
<head>
<title>http://www.xtx.kr</title>
<script>
//Created by: Paul Tuckey | http://tuckey.org/ */
function countLines(strtocount, cols) {
var hard_lines = 1;
var last = 0;
while ( true ) {
last = strtocount.indexOf("\n", last+1);
hard_lines ++;
if ( last == -1 ) break;
}
var soft_lines = Math.round(strtocount.length / (cols-1));
var hard = eval("hard_lines " + unescape("%3e") + "soft_lines;");
if ( hard ) soft_lines = hard_lines;
return soft_lines;
}
function cleanForm() {
var the_form = document.forms[0];
for ( var x in the_form ) {
if ( ! the_form[x] ) continue;
if( typeof the_form[x].rows != "number" ) continue;
the_form[x].rows = countLines(the_form[x].value,the_form[x].cols) +1;
}
setTimeout("cleanForm();", 300);
}
// Multiple onload function created by: Simon Willison
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent
function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != 'function') {
window.onload = func;
} else {
window.onload = function() {
if (oldonload) {
oldonload();
}
func();
}
}
}
addLoadEvent(function() {
cleanForm();
});
</script>
</head>
<body>
<form>
<textarea cols="40" rows="2" name="reason">
ÀÌ°÷¿¡ ³»¿ëÀ» ÂÞ¿í ÀÔ·ÂÇغ¸¼¼¿ä.. ³»¿ëÀÌ ´Ã¾î³ª¸é Textarea¹Ú½º°¡ ÀÚµ¿À¸·Î ´Ã¾î³³´Ï´Ù..
</textarea>
</form>
</body>
</html> |
|
̵̧ : 291 |
̵̧
¸ñ·Ï
|
|