jqueryvalidation.jsを使用してフォームの検証を検証しようとしています。エラーがどこにあるか私にはわからない私はこのコードを使用しますが、検証がjQuery Validateが機能しない必要があります。理由を知りたい
<script type="text/javascript" src = "${contextPath }/static/js/jquery-migrate-1.4.1.min.js"></script>
<script type="text/javascript">
window.jQuery || document.write("<script src='${contextPath}/static/ace_admin1.3.1/assets/js/jquery.min.js'>"+"<"+"/script>");
</script>
<script type="text/javascript" src = "${contextPath }/static/js/jquery.validate.min.js"></script>
<script type="text/javascript">
$.validator.setDefaults({
submitHandler: function() {
alert("sumbit");
}
});
$(function() {
$("#subjectForm").validate({
rules: {
name : {
required: true,
},
testCount : {
required: true,
},
totalTime : {
required: true,
},
totalScore : {
required: true,
}
},
});
});
</script>
</head>
<body>
<form id="subjectForm " action="${contextPath }/teacher/testAddSubject" method="POST">
<p>add</p>
<p><label>subjectName</label><input name = "name" type ="text"/></p>
<p><label>Description</label><input name = "description" type ="text"/></p>
<p><label>number</label><input name = "testCount" type ="text"/></p>
<p><label>time</label><input name = "totalTime" type ="text"/></p>
<p><label>grade</label><input name = "totalScore" type ="text" /></p>
<button type="submit">submit</button>
</form>
</body>
</html>
を動作していないこと
HTTP Status 400 -
type Status report
message
description The request sent by the client was syntactically incorrect.
よう ブラウザの応答は、jQueryのバージョンとjQueryの検証バージョンについてme.itを助けてください?
最初のオフ: '$ {contextPath}'は実際のコードではありません。***ブラウザでレンダリングされたコード***は、JavaScriptが使用しているものです。第二に、あなたの問題はJavaScriptとは関係ありません。ここで状態コード400の定義は次のとおりです。*「不正な構文のために要求がサーバーによって理解できませんでした。クライアントは変更を加えずに要求を繰り返すべきではありません」* – Sparky