여분필드 내용에 따라 설명 보여주기 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

여분필드 내용에 따라 설명 보여주기 정보

여분필드 내용에 따라 설명 보여주기

본문

글 작성 시에 여분필드 값에 따라 실시간으로 설명을 보여주는 자바스크립트입니다.

=== write.skin.php ===

<select name='wr_3' itemname="상태레벨" onChange="showtext()" required>
    <option value=''>등급선택
    <option value='신품'>신품
    <option value='중고'>중고
    </select> <textarea rows=1 cols=50 wrap="virtual" name="text" style="border:none;overflow-y:hidden;" readonly></textarea>


<script language="javascript">
<!--

var shortcut=document.fwrite
var descriptions=new Array()
    descriptions[0]="상태레벨을 선택하세요"
    descriptions[1]="신품 : 착용하지 않은 제품의 상태"
    descriptions[2]="중고 : 최소 1회라도 착용한 제품의 상태"   

    shortcut.text.value=descriptions[shortcut.wr_3.selectedIndex]

function gothere(){
    location=shortcut.wr_3.options[shortcut.wr_3.selectedIndex].value
}

function showtext(){
    shortcut.text.value=descriptions[shortcut.wr_3.selectedIndex]
}
//-->
</script>

추천
2
  • 복사

댓글 2개

© SIRSOFT
현재 페이지 제일 처음으로