function validform() {
return $("-sharpreset_passwd").validate({
rules: {
password: {
required: true,
minlength: 6
},
confirm_password: {
required: true,
minlength: 6,
equalTo: "-sharppassword"
}
},
});
}
$(validform());
$("-sharpssss").click(function() {
if (validform().form()) {
$.ajax({
type : "POST",
url : "users",
data : $("-sharpreset_passwd").serialize(),
success : function(msg) {
alert(1)
},
error : function(mes) {
alert(2)
}
});
} else {
}
});