<script>
$(document).ready(function() {
var isUnameExist = false;
//$("#frmregister").validate();
$("#frmregister").validate({
rules: {
username:{
required:true,
custom_usernameValidate:true
}
}
});
$.validator.addMethod('custom_usernameValidate', function(val) {
$.ajax({
type:'post',
url:"http://localhost/myproj/ajaxchecking.php",
data:{'username':val},
async:false,
success:function(data){
//console.log(data);
if(data == 'no')
isUnameExist = true;
else
isUnameExist = false;
}
});
return isUnameExist;
},"username already exist");
});
</script>
Wednesday, July 23, 2014
Check Username exist - Ajax
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment