jQuery에서 라디오 버튼 양식을 사용하여 유효성을 검사하도록하려고합니다. 당신은 jQuery를위한 어떤 규칙을 지정하지 않은jQuery 유효성 검사 문제
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#formq").validate();
});
</script>
<style type="text/css">
<!--
label.error {display: none;}
//-->
</style>
</head>
<body>
<form id="formq" name="formq" action="check.php" method="post">
<fieldset>
<input type="hidden" name="check_submit" value="1" />
<label for="radio-1" tabindex="1" class="circle">Circle</label>
<input type="radio" name="radio-button" id="radio-1" value="Circle" validate="required:true" />
<label for="radio-2" tabindex="2" class="pentagon">Pentagon</label>
<input type="radio" name="radio-button" id="radio-2" value="Pentagon" />
<label for="radio-3" tabindex="3" class="triangle">Triangle</label>
<input type="radio" name="radio-button" id="radio-3" value="Triangle" />
<label for="radio-4" tabindex="4" class="hexagon">Hexagon</label>
<input type="radio" name="radio-button" id="radio-4" value="Hexagon" />
<label for="radio-5" tabindex="5" class="square">Square</label>
<input type="radio" name="radio-button" id="radio-5" value="Square" />
<label for="radio-6" tabindex="6" class="octagon">Octagon</label>
<input type="radio" name="radio-button" id="radio-6" value="Octagon" />
<label for="radio" class="error">Please select your gender</label>
<input class="submit" type="submit" value="Submit"/>
</fieldset>
</form>
</body>
</html>
나만의 것인지 모르지만 그 문서는 다소 이해하기 쉽습니다. – tenshimsm