Quantcast
Channel: 여유로움을 추구하는 아웃사이더
Viewing all articles
Browse latest Browse all 261

javascript radio checked 확인

$
0
0
라디오 버튼의 경우 똑같은 이름으로 여러개가 있는 경우 이는 자동으로 배열로 처리됩니다.따라서 document.form.comm_stat_flag 는 이미 배열로 되어 있는 상태이고 배열.value 라는 것은 없기 때문에 undifind 가 나오게 되는겁니다.그래서 배열로 접근을 하셔야 하는데 그 방법은 이미 아시겠지만 document.form.comm_stat_flag[0] 이렇게 접근을 하셔야 하고comm_stat_flag 가 두개가 있기때문에 document.form.comm_stat_flag[1] 까지 유효한 오브젝트가 되는겁니다.자바스크립트에서 배열의 시작은 0 이기 때문에 2개면 0,1 이렇게 두개가 되는거죠따라서 document.form.comm_stat_flag[0].value 이렇게 접근을 하셔야 value 값을 참조하.......

Viewing all articles
Browse latest Browse all 261

Latest Images

Trending Articles

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>