웹마스터 팁

<!-- TWO STEPS TO INSTALL LIMIT TEXTAREA:
<!-- textarea의 입력 제한 설치 2단계 -->
  1.  Copy the coding into the HEAD of your HTML document
<!-- //1. html의 head에 소스를 넣어준다. -->
  2.  Add the last code into the BODY of your HTML document  -->
<!-- //2. html의 body에 소스를 넣어준다. -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->
<!-- //1단계 : html의 head에 아래의 소스를 넣어라. -->
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Ronnie T. Moore -->
<!-- Web Site:  The JavaScript Source -->
<!-- //원작자와 사이트명 -->
<!-- Dynamic 'fix' by: Nannette Thacker -->
<!-- Web Site: http://www.shiningstar.net -->
<!-- //수정한사람과 사이트명 -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- //이곳에 더많은 좋은 정보가 있다.  -->

<!-- Begin
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
End -->
<!-- //  textcounter 함수의 시작과 끝, 위의 부분을 head에 넣어줌 -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document  -->
<!-- //2단계 : html의 body에 아래의 코드를 넣어라. -->
<BODY>

<!-- textCounter() parameters are:  text field, the count field, max length -->
<!-- //textcounter()에 사용되는 것들 : 텍스트필드, 카운트필드, 최대입력수 -->

<!-- //여기서부터는 위의 스크립트를 사용한 예제임(125자로 제한). 알맞게 수정하면 됨.... -->
<center>
<form name=myform action="YOUR-SCRIPT.CGI">
<font size="1" face="arial, helvetica, sans-serif"> ( You may enter up to 125 characters. )<br>
<textarea name=message wrap=physical cols=28 rows=4 onKeyDown="textCounter(this.form.message,this.form.remLen,125);" onKeyUp="textCounter(this.form.message,this.form.remLen,125);"></textarea>
<br>
<input readonly type=text name=remLen size=3 maxlength=3 value="125"> characters left</font>
<!-- 몇자남았는지카운트해주는부분 -->
</form>
</center>

<p><center>
<font face="arial, helvetica" SIZE="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size:  1.37 KB -->

쉽게 말해서 head에 이걸 넣어줍니다.
<SCRIPT LANGUAGE="JavaScript">
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
</script>

body에는 위의 예처럼 사용합니다. (맞게 수정하시면 됩니다.)
<form name=myform action="YOUR-SCRIPT.CGI">
<font size="1" face="arial, helvetica, sans-serif"> ( You may enter up to 125 characters. )<br>
<textarea name=message wrap=physical cols=28 rows=4 onKeyDown="textCounter(this.form.message,this.form.remLen,125);" onKeyUp="textCounter(this.form.message,this.form.remLen,125);"></textarea>
<br>
<input readonly type=text name=remLen size=3 maxlength=3 value="125"> characters left</font>
</form>
제목 글쓴이 날짜
Mysql 4.0 버전에서 xe 설치해서 사용하기 [3] amamamam.myid.net 2007.08.13
(파일 첨부) 파일명 안보일 때 ... 없애기 [9] Simulz 2007.09.10
apmsetup5를 이용한 zbxe 설치 및 복구 [2] 무도사 2007.11.02
UTF-8과 Euc-kr 동시에 사용하기 [10] 써니a 2007.11.05
제로보드에서 로그인후 테크노트에서 로그인정보 사용하기 [4] JinHoHan 2007.12.26
HTTP 406 Error 가 나오면서 업로드 안될때 [16] file plruto 2008.02.08
[펌] Apache rewrite Module [8] ☜ TeRy ☞ 2008.02.22
자료 첨부 문제 단풍534 2008.07.15
[초간단]회원팝업메뉴에 메뉴넣기 [1] Pw-NET 2008.11.30
XE DB 백업한거 복원 하기 [2] 라르게덴 2009.03.17
폴더에 올린 mp3를 자동으로 podcast로 만들어주는 소스... ^^ [2] 하얀마법 2010.09.11
Microsoft 에이전트를 이용해서 멋나게 꾸며보자 -_-)/ [7] 티르-_-)/ 2002.02.23
textarea 입력받는 글자수 제한하는 스크립트 [5] 오기 2002.01.17
▩찾기 기능을 내 홈페이지에 넣어보자 [1] ▩윤미 2002.02.26
윈도우 할아버지 나타나게 하기 [11] 행복한고니 2002.11.14
[re] 아래 행복한고니님의 할아버지 소스의 업글(?) 버젼입니다. [2] Mahican 2002.12.02
아래 행복한고니님의 할아버지 소스의 업글(?) 버젼입니다. [7] (づ_-) 커터칼 2002.11.18
자바스크립트용 계산기 v1.0 [4] 찐군 2003.01.09
메인 접속하면 할아버지 나오는... [6] 공유 2003.08.28
[초간단 자바스크립트!] 자바로 플래시 따라하기! [3] ∑Ztxy 2003.10.15