웹마스터 팁

<!-- 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>
제목 글쓴이 날짜
공지사항|일기장 4강 - notice.php 간단한 글보이기 시루바 2003.10.16
회원 포인트 랭킹(중복 -_-a) [4] file weky 2003.11.15
제로보드회원의 포인트 랭킹 체크하기 sql 정리 [4] 한꼬마 2003.11.26
DB에서 받은 데이터 배열로 하나씩 뿌리기 LetMeLove 2003.12.09
한꼬마의 제로보드 활용법 (게시물 추출하기) [4] 한꼬마 2004.02.17
여러 DB에서 최근 게시물 추출하기 위한 소스 입니다. [6] NS 2004.02.21
나만의 미니홈 만들기 ㅡ list.php , 디비 테이블 생성 [6] file 예뜨락 2004.11.26
나만의 미니홈 만들기 ㅡ view.php 파일과 제목링크 [9] file 예뜨락 2004.11.27
나만의 미니홈 만들기 ㅡ메뉴에 게시판 연결 [5] file 예뜨락 2004.12.17
나만의 미니홈 만들기 ㅡ 간단한 최근글 불러오기 [6] 예뜨락 2005.05.09
나만의 미니홈 만들기 ㅡ 메모장 소스 예뜨락 2005.06.09
[PHP 동영상강의] 32. 자료의 정렬순서를 바꿔보자. [8] 서기 2006.01.11
다운로드 이어 받기 및 전송속도 제한 구현 [1] 박원형 2006.12.11
[알아서 나쁠것없는 10원짜리 팁!] 수십 수백명사용자의 일괄생성 방법! [6] 임현 2002.05.09
제로보드 data 폴더 일괄적으로 소유권 변경 스크립트 [2] 라지엘 2002.07.01
[FreeBSD] qmail+mysql+vpopmail+qmailadmin 설치 [1] DeX™ 2002.11.26
초보자도 쉽게 이해할수있도록 주석을 자세히 달아놓은 APM 메뉴얼 (2 of 4) [4] Dopesoul 2002.12.18
무료 호스팅 서버 만들기 -4부 [18] 장동민 2003.01.04
htaccess를 활용하자 3탄! 사용자인증 [4] [쿨럭]블루엔젤 2003.01.23
phpMyAdmin 보안설정하기 [5] 겨울늑대 2003.02.27