0
私はボタンクリックイベントで動作するjavascriptの関数を持っています。トータルフォームの検証がtrueを返す場合にのみ機能する関数が必要です。私はフォームを検証するためにjqueryバリデーションプラグインを使用しています。バリデーションは適切に機能していますが、ボタンをクリックすると、バリデーションはありますが、まだその機能の中に入っています。ボタンクリックイベントは、検証が与えられても動作しています
私はこのような関数を呼び出しています:
document.getElementById('btnNext').addEventListener('click', handleFileSelect, false);
function handleFileSelect(evt) {
//My Code goes here
}
//This is my form..
<form id="someID">
<button id ="next" type="submit">
</form>
//And my validation will be as follows:
$("#posterForm").validate({
rules: {
//Here all the validation rules
},
messages: {
//Here all the error messages
}
});