게시판 글스기에서 아래 <input 을 사용하고있습니다.
글쓰기에서 <input 에 "숫자만 입력하세요" 라고 써놓고
마우스로 입력란을 클릭하면 "숫자만 입력하세요" 라는글자가 없어지는 기능을
구현하고싶은데. 어떻게 해야하는지 도움좀 부탁드립니다.
<input style='border:0px; font-size:9pt; width=109px; HEIGHT:15px; bordercolor:#999999 solid;' name=wr_1 itemname="연락처" value="<?=$write[wr_1]?>" numeric required>
글쓰기에서 <input 에 "숫자만 입력하세요" 라고 써놓고
마우스로 입력란을 클릭하면 "숫자만 입력하세요" 라는글자가 없어지는 기능을
구현하고싶은데. 어떻게 해야하는지 도움좀 부탁드립니다.
<input style='border:0px; font-size:9pt; width=109px; HEIGHT:15px; bordercolor:#999999 solid;' name=wr_1 itemname="연락처" value="<?=$write[wr_1]?>" numeric required>
댓글을 작성하시려면 로그인이 필요합니다.
댓글 4개
거기보면 아이디 입력란에 아이디 라고 미리 텍스트 들어가있자나요 그걸 응용하시면 됩니다.
저의 실력으론 여기까지네요 ㅠ.ㅠ
<head>
<script language='javascript'>
function Change (target,type)
{
if ( target.value == target.defaultValue && type==0) target.value = '';
if ( !target.value && type==1) target.value = target.defaultValue;
}
</script>
</head>
<body>
<input type='text' name='r_add' value="숫자만 입력하세요." onFocus='Change(this,0)' onBlur='Change(this,1)' >