개발

[javascript] radio 유효성 체크

지승준 2015. 12. 4. 10:23
1
2
3
4
5
6
7
8
9
10
11
12
//체크값 확인
$(':radio[name="test"]:checked').val();
 
//체크여부 확인
$('.test :input[value="1"]').is(":checked");
 
//유효성검사
if($(':radio[name="test"]:checked').length < 1){
    alert('테스트를 선택해주세요.');
    document.frm.test[0].focus();
    return false;
}
cs


'개발' 카테고리의 다른 글

[jquery] 금액 콤마 찍기  (0) 2016.01.08
[javascript] 따라다니는 메뉴  (0) 2015.12.07
[javascript] 랜덤 메뉴  (0) 2015.08.17
[javascript] 화면크기구하기  (0) 2015.08.17
[javascript] 셀병합, rowspan  (0) 2015.07.22