remote로 한개이상의 파라미터를 보내야할때 data를 활용해보자
아래코드를 GET으로 표현해보면 check-email.php?username=hong&username2=kim 이런식으로 전송하게된다.
$(“#myform”).validate({
rules: {
email: {
required: true,
email: true,
remote: {
url: “check-email.php”,
type: “post”,
data: {
username: function() {
return $(“#username”).val();
}
username2: function() {
return $(“#username2″).val();
}
}
}
}
}
});