아무도 다음 코드가 작동하지 않는 이유를 말해 줄 수 있습니까?왜 유효성 검사기가 작동하지 않습니까?
<script type="text/javascript" src="../../Scripts/jquery.js"></script>
<script type="text/javascript" src="../../Scripts/jquery.validate.js"></script>
<script type="text/javascript">
$(function() {
// validate contact form on keyup and submit
$("#myform").validate({
//set the rules for the fild names
rules: {
hour: {
required: true,
minlength: 2,
range:[0,23]
},
minute: {
required: true,
minlength: 2,
range:[0,60]
},
},
//set messages to appear inline
messages: {
hour: "Please enter a valid hour",
minute: "Please enter a valid minute"
}
});
});
</script>
<style type="text/css">
.error {
color: red;
font: 12pt verdana;
padding-left: 10px
}
</style>
<form id="myform" method="" action="">
<input id="hour" type="text" name="hour" style="width:30px; text-align:center;"></input> :
<input id="minute" type="text" name="minute" style="width:30px; text-align:center;"></input>
<br/>
<input type="submit" value="Validate!" />
</form>
미리 감사드립니다 만, 리나
예,이 질문을 읽는 사람의 마음을 읽을 수있는 노력 : 여기에 마이크로 소프트 CDN에서 JQuery와 및 jquery.validate를 사용하여 작업 예제가있다? 우리에게 단서를주고, 방화범이 끌려오고있는 어떤 오류가 있습니까? –
명확히 지정하지 않아서 미안 해요. 저는 초보자입니다. 나는 어떤 오류나 경고 나 다른 어떤 것도 얻지 못하고 있습니다, 그것은 단지 작동하지 않습니다! 잘못된 값을 입력 할 때 오류 메시지가 표시되지 않고 "확인"버튼을 클릭하면 필드에 쓴 모든 내용이 사라집니다. 이유가 무엇입니까? – Lina