Hi,
Am trying to get some data from DB , here am checking whether username is registered or not , if he register am getting some data related to that user and displaying on window .
I want function to wait for untill user finish typing his username ,
then run the function , Below is my code ,
$(function (){
var minlength = 2;
$("#username").keyup(function () {
var that = this,
value = $(this).val();
if (value.length >= minlength ) {
$.ajax({
type: "GET",
url: "Path_to_php",
data: {'username' : value},
dataType: "html",
success: function(data){
if (value==$(that).val()) {
$("#content").append("<p>" + data + "</p>");
}
else {
alert ("Username Not Registered");
}
}
});
}
});
});
Here , when user start entering his name , that time only Function getting call for each char he entered
Thank you
Pervez