몇시간 검색한 결과, 힘들게 해결했습니다. validation option 에서 onsubmit: false 처리하고,
Submit 버튼을 클릭(click)하도록 처리하는 방법입니다.
<script>
var validationParams = {
errorElement: 'span', //default input error message container
errorClass: 'help-block', // default input error message class
focusInvalid: true, // do not focus the last invalid input
onsubmit: false,
rules: {},
messages: {},
invalidHandler: function (event, validator) { //display error alert on form submit
... 생략 ...
var username = $("[id$='UserName']").attr("name");
var password = $("[id$='Password']").attr("name");
validationParams['rules'][username] = { required: true };
validationParams['messages'][username] = { required: "Username is required." };
validationParams['rules'][password] = { required: true };
validationParams['messages'][password] = { required: "Password is required." };
$('form').validate(validationParams);
$('form input').keypress(function (e) {
if (e.which == 13) {
if ($('form').validate().form()) {
//$('form').submit(); //form validation success, call ajax form submit
$("[id$='LoginButton']").click();
}
e.preventDefault();
return false;
}
});
</script>