Skip to content

Instantly share code, notes, and snippets.

@phpleo
Created December 28, 2011 20:44
Show Gist options
  • Save phpleo/1529644 to your computer and use it in GitHub Desktop.
Save phpleo/1529644 to your computer and use it in GitHub Desktop.
Sobreescibir remote: de Jquery.validate
// http://forum.jquery.com/topic/validate-using-remote-webservice-and-json-not-working
$(".fieldUsername").rules("add", {
remote: function(){
var r={
type: "POST",
url: "/wservices/clientscriptservices.asmx/CheckUserNameExist",
contentType: "application/json; charset=utf-8",
dataType: "json",
data: "{'username':'" + $(".fieldUsername").val() + "'}"
}
return r;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment